More eslint fixes (+ ignoring no-unsafe-argument rule for now)
This commit is contained in:
parent
98d3a58861
commit
0c281db411
9 changed files with 76 additions and 21 deletions
|
@ -41,7 +41,8 @@ module.exports = {
|
|||
"@typescript-eslint/no-unsafe-assignment": "off",
|
||||
"@typescript-eslint/no-unsafe-return": "off",
|
||||
"@typescript-eslint/no-unsafe-member-access": "off",
|
||||
"@typescript-eslint/restrict-template-expressions": "off"
|
||||
"@typescript-eslint/restrict-template-expressions": "off",
|
||||
"@typescript-eslint/no-unsafe-argument": "off",
|
||||
},
|
||||
"settings": {
|
||||
"svelte3/typescript": true,
|
||||
|
|
|
@ -12,6 +12,8 @@ import { userIsConnected } from "../Stores/MenuStore";
|
|||
import { analyticsClient } from "../Administration/AnalyticsClient";
|
||||
import { axiosWithRetry } from "./AxiosUtils";
|
||||
import axios from "axios";
|
||||
import { isRegisterData } from "../Messages/JsonMessages/RegisterData";
|
||||
import { isAdminApiData } from "../Messages/JsonMessages/AdminApiData";
|
||||
|
||||
class ConnectionManager {
|
||||
private localUser!: LocalUser;
|
||||
|
@ -126,6 +128,10 @@ class ConnectionManager {
|
|||
const data = await Axios.post(`${PUSHER_URL}/register`, { organizationMemberToken }).then(
|
||||
(res) => res.data
|
||||
);
|
||||
if (!isRegisterData(data)) {
|
||||
console.error("Invalid data received from /register route. Data: ", data);
|
||||
throw new Error("Invalid data received from /register route.");
|
||||
}
|
||||
this.localUser = new LocalUser(data.userUuid, data.textures, data.email);
|
||||
this.authToken = data.authToken;
|
||||
localUserStore.saveUser(this.localUser);
|
||||
|
@ -326,7 +332,9 @@ class ConnectionManager {
|
|||
}
|
||||
const { authToken, userUuid, textures, email } = await Axios.get(`${PUSHER_URL}/login-callback`, {
|
||||
params: { code, nonce, token, playUri: this.currentRoom?.key },
|
||||
}).then((res) => res.data);
|
||||
}).then((res) => {
|
||||
return res.data;
|
||||
});
|
||||
localUserStore.setAuthToken(authToken);
|
||||
this.localUser = new LocalUser(userUuid, textures, email);
|
||||
localUserStore.saveUser(this.localUser);
|
||||
|
|
|
@ -426,7 +426,7 @@ export const localStreamStore = derived<Readable<MediaStreamConstraints>, LocalS
|
|||
// TODO: does it make sense to pop this error when retrying?
|
||||
set({
|
||||
type: "error",
|
||||
error: e,
|
||||
error: e instanceof Error ? e : new Error("An unknown error happened"),
|
||||
});
|
||||
// Let's try without video constraints
|
||||
if (constraints.video !== false) {
|
||||
|
@ -444,7 +444,7 @@ export const localStreamStore = derived<Readable<MediaStreamConstraints>, LocalS
|
|||
console.info("Error. Unable to get microphone and/or camera access.", constraints, e);
|
||||
set({
|
||||
type: "error",
|
||||
error: e,
|
||||
error: e instanceof Error ? e : new Error("An unknown error happened"),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -153,7 +153,7 @@ export const screenSharingLocalStreamStore = derived<Readable<MediaStreamConstra
|
|||
console.info("Error. Unable to share screen.", e);
|
||||
set({
|
||||
type: "error",
|
||||
error: e,
|
||||
error: e instanceof Error ? e : new Error("An unknown error happened"),
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
|
|
@ -7,7 +7,7 @@ class TouchScreenManager {
|
|||
|
||||
//found here: https://stackoverflow.com/questions/4817029/whats-the-best-way-to-detect-a-touch-screen-device-using-javascript#4819886
|
||||
detectTouchscreen(): boolean {
|
||||
return "ontouchstart" in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0;
|
||||
return "ontouchstart" in window || navigator.maxTouchPoints > 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue