feat(ui): explicit offline state inside an online game (+ offline word check) #260
@@ -3,7 +3,6 @@
|
|||||||
import { gateway } from '../lib/gateway';
|
import { gateway } from '../lib/gateway';
|
||||||
import { gameSource, isLocalGameId } from '../lib/gamesource';
|
import { gameSource, isLocalGameId } from '../lib/gamesource';
|
||||||
import { connection } from '../lib/connection.svelte';
|
import { connection } from '../lib/connection.svelte';
|
||||||
import { localWordCheck } from '../lib/dict/check';
|
|
||||||
import { handleError, showToast } from '../lib/app.svelte';
|
import { handleError, showToast } from '../lib/app.svelte';
|
||||||
import { t } from '../lib/i18n/index.svelte';
|
import { t } from '../lib/i18n/index.svelte';
|
||||||
import { alphabetLetters } from '../lib/alphabet';
|
import { alphabetLetters } from '../lib/alphabet';
|
||||||
@@ -57,6 +56,9 @@
|
|||||||
// pinned dictionary read on-device: exact when that dawg is cached/bundled, otherwise the check
|
// pinned dictionary read on-device: exact when that dawg is cached/bundled, otherwise the check
|
||||||
// is unavailable. A local game already resolves checkWord on-device, so it keeps that path.
|
// is unavailable. A local game already resolves checkWord on-device, so it keeps that path.
|
||||||
if (!isLocalGameId(id) && !connection.online) {
|
if (!isLocalGameId(id) && !connection.online) {
|
||||||
|
// Dynamically imported so the dawg reader/loader stays out of the app entry bundle (the dict
|
||||||
|
// subsystem is lazy everywhere else too); it loads only when an offline check actually runs.
|
||||||
|
const { localWordCheck } = await import('../lib/dict/check');
|
||||||
const legal = await localWordCheck(variant, dictVersion, w);
|
const legal = await localWordCheck(variant, dictVersion, w);
|
||||||
if (legal === null) {
|
if (legal === null) {
|
||||||
result = null;
|
result = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user