@@ -12,7 +12,7 @@ if (typeof LIVE_RELOAD !== "undefined" && LIVE_RELOAD) {
1212import { dictionary } from "../dictionary/dictionary.ts" ;
1313import { asComment } from "../dictionary/misc.ts" ;
1414import PROJECT_DATA from "../project_data.json" with { type : "json" } ;
15- import { ArrayResultError } from "./array_result.ts" ;
15+ import { ArrayResultError , isArrayResult } from "./array_result.ts" ;
1616import { loadCustomDictionary } from "./dictionary.ts" ;
1717import { checkLocalStorage , setIgnoreError } from "./local_storage.ts" ;
1818import { flattenError } from "../misc/misc.ts" ;
@@ -144,7 +144,7 @@ function main(): void {
144144 try {
145145 loadCustomDictionary ( customDictionary ) ;
146146 } catch ( error ) {
147- errorDisplay . innerText = errorsFixable ( flattenError ( error ) )
147+ errorDisplay . innerText = isArrayResult ( flattenError ( error ) )
148148 ? DICTIONARY_LOADING_FAILED_FIXABLE_MESSAGE
149149 : DICTIONARY_LOADING_FAILED_UNFIXABLE_MESSAGE ;
150150 // deno-lint-ignore no-console
@@ -276,7 +276,7 @@ function main(): void {
276276 customDictionaryDialogBox . close ( ) ;
277277 } catch ( error ) {
278278 const errors = flattenError ( error ) ;
279- const message = errorsFixable ( errors )
279+ const message = isArrayResult ( errors )
280280 ? DICTIONARY_ERROR_FIXABLE_MESSAGE
281281 : DICTIONARY_ERROR_UNFIXABLE_MESSAGE ;
282282 const errorListMessage = errors
@@ -300,10 +300,6 @@ function extractErrorMessage(error: unknown): string {
300300 return `${ error } ` ;
301301 }
302302}
303- function errorsFixable ( errors : ReadonlyArray < unknown > ) : boolean {
304- return errors . length > 0 &&
305- errors . every ( ( error ) => error instanceof ArrayResultError ) ;
306- }
307303
308304if ( document . readyState === "loading" ) {
309305 document . addEventListener ( "DOMContentLoaded" , main ) ;
0 commit comments