aboutsummaryrefslogtreecommitdiff
path: root/src/client/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/util')
-rw-r--r--src/client/util/Import & Export/ImageUtils.ts4
-rw-r--r--src/client/util/PingManager.ts2
-rw-r--r--src/client/util/SettingsManager.tsx3
3 files changed, 5 insertions, 4 deletions
diff --git a/src/client/util/Import & Export/ImageUtils.ts b/src/client/util/Import & Export/ImageUtils.ts
index f73149fdc..43807397f 100644
--- a/src/client/util/Import & Export/ImageUtils.ts
+++ b/src/client/util/Import & Export/ImageUtils.ts
@@ -8,9 +8,9 @@ import { Upload } from '../../../server/SharedMediaTypes';
import { Networking } from '../../Network';
export namespace ImageUtils {
- export const ExtractImgInfo = async (document: Doc): Promise<Upload.InspectionResults | undefined> => {
+ export const ExtractImgInfo = async (document: Doc) => {
const field = Cast(document.data, ImageField);
- return field ? Networking.PostToServer('/inspectImage', { source: field.url.href }) : undefined;
+ return field ? (Networking.PostToServer('/inspectImage', { source: field.url.href }) as Promise<Upload.InspectionResults>) : undefined;
};
export const AssignImgInfo = (document: Doc, data?: Upload.InspectionResults) => {
diff --git a/src/client/util/PingManager.ts b/src/client/util/PingManager.ts
index 170632836..0e4f8cab0 100644
--- a/src/client/util/PingManager.ts
+++ b/src/client/util/PingManager.ts
@@ -29,7 +29,7 @@ export class PingManager {
});
Networking.PostToServer('/ping', { date: new Date() })
.then(res => {
- SnappingManager.SetServerVersion(res.message);
+ SnappingManager.SetServerVersion((res as { message: string }).message);
!this.IsBeating && setIsBeating(true);
})
.catch(() => this.IsBeating && setIsBeating(false));
diff --git a/src/client/util/SettingsManager.tsx b/src/client/util/SettingsManager.tsx
index 5d041f7b4..6ea242fc3 100644
--- a/src/client/util/SettingsManager.tsx
+++ b/src/client/util/SettingsManager.tsx
@@ -598,7 +598,8 @@ export class SettingsManager extends React.Component<object> {
});
} else {
const passwordBundle = { curr_pass: this._curr_password, new_pass: this._new_password, new_confirm: this._new_confirm };
- const { error } = await Networking.PostToServer('/internalResetPassword', passwordBundle);
+ const reset = await Networking.PostToServer('/internalResetPassword', passwordBundle);
+ const { error } = reset as { error: { msg: string }[] };
runInAction(() => {
this._passwordResultText = error ? 'Error: ' + error[0].msg + '...' : 'Password successfully updated!';
});