diff --git a/package.json b/package.json index f905106c9d8..22ba1b8a22e 100644 --- a/package.json +++ b/package.json @@ -207,7 +207,7 @@ "typedoc-plugin-exclude-references": "^1.0.0", "typedoc-plugin-external-module-name": "^4.0.6", "typedoc-plugin-rename-named-parameters": "^1.0.6", - "typescript": "^4.3.2", + "typescript": "^4.9.5", "webdriverio": "^7.7.3" } } diff --git a/src/components/modals/Export.tsx b/src/components/modals/Export.tsx index 8eaf3da8347..364b713426d 100644 --- a/src/components/modals/Export.tsx +++ b/src/components/modals/Export.tsx @@ -422,7 +422,7 @@ const ModalExport: FC<{ simplePath: SimplePath }> = ({ simplePath }) => { else { try { download(exportContent!, `em-${title}-${timestamp()}.${selected.extension}`, selected.type) - } catch (e) { + } catch (e: any) { dispatch(error({ value: e.message })) console.error('Download Error', e.message) } diff --git a/src/components/modals/Signup.tsx b/src/components/modals/Signup.tsx index c00e57f22c9..b6e54576462 100644 --- a/src/components/modals/Signup.tsx +++ b/src/components/modals/Signup.tsx @@ -71,8 +71,8 @@ const ModalSignup = () => { // Set the invite code and is validating to false, only if code is valid. setInviteCode(inviteCode) setIsValidatingCode(false) - } catch (err) { - setValidationError(err.message) + } catch (e: any) { + setValidationError(e.message) setIsValidatingCode(false) } }, diff --git a/src/device/download.ts b/src/device/download.ts index cf9edc6e43c..fa342fcfc80 100644 --- a/src/device/download.ts +++ b/src/device/download.ts @@ -6,24 +6,17 @@ import MimeType from '../@types/MimeType' const download = (data: string, filename: string, type: MimeType = 'text/plain') => { const file = new Blob([data], { type }) - // IE10+ - if (window.navigator.msSaveOrOpenBlob) { - window.navigator.msSaveOrOpenBlob(file, filename) - } - // Others - else { - const a = document.createElement('a') - const url = URL.createObjectURL(file) - a.href = url - a.download = filename - document.body.appendChild(a) - a.click() + const a = document.createElement('a') + const url = URL.createObjectURL(file) + a.href = url + a.download = filename + document.body.appendChild(a) + a.click() - setTimeout(() => { - document.body.removeChild(a) - window.URL.revokeObjectURL(url) - }, 0) - } + setTimeout(() => { + document.body.removeChild(a) + window.URL.revokeObjectURL(url) + }, 0) } export default download diff --git a/src/test-helpers/createTestStore.ts b/src/test-helpers/createTestStore.ts index 5a8721f8018..171bc0fa012 100644 --- a/src/test-helpers/createTestStore.ts +++ b/src/test-helpers/createTestStore.ts @@ -9,7 +9,8 @@ import multi from '../redux-middleware/multi' * Returns new store for test. */ export const createTestStore = () => { - const store = createStore(appReducer, compose(applyMiddleware(multi, thunk), undoRedoEnhancer)) + // TODO: Type properly + const store = createStore(appReducer, compose(applyMiddleware(multi, thunk), undoRedoEnhancer) as any) store.dispatch([ // skip tutorial diff --git a/yarn.lock b/yarn.lock index fc97440c789..da5d10c404b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16468,10 +16468,10 @@ typescript@3.7.x: resolved "https://registry.npmjs.org/typescript/-/typescript-3.7.7.tgz" integrity sha512-MmQdgo/XenfZPvVLtKZOq9jQQvzaUAUpcKW8Z43x9B2fOm4S5g//tPtMweZUIP+SoBqrVPEIm+dJeQ9dfO0QdA== -typescript@^4.3.2: - version "4.3.2" - resolved "https://registry.npmjs.org/typescript/-/typescript-4.3.2.tgz" - integrity sha512-zZ4hShnmnoVnAHpVHWpTcxdv7dWP60S2FsydQLV8V5PbS3FifjWFFRiHSWpDJahly88PRyV5teTSLoq4eG7mKw== +typescript@^4.9.5: + version "4.9.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" + integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== typeson-registry@^1.0.0-alpha.20: version "1.0.0-alpha.39"