mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-08-09 16:53:04 +08:00
Revert "feat: improve components structure"
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { trimTopic, getMessageTextContent } from "../utils";
|
||||
|
||||
import Locale, { getLang } from "../locales";
|
||||
import { showToast } from "@/app/components/ui-lib";
|
||||
import { showToast } from "../components/ui-lib";
|
||||
import { ModelConfig, ModelType, useAppConfig } from "./config";
|
||||
import { createEmptyMask, Mask } from "./mask";
|
||||
import {
|
||||
|
@@ -10,7 +10,7 @@ import {
|
||||
setLocalAppState,
|
||||
} from "../utils/sync";
|
||||
import { downloadAs, readFromFile } from "../utils";
|
||||
import { showToast } from "@/app/components/ui-lib";
|
||||
import { showToast } from "../components/ui-lib";
|
||||
import Locale from "../locales";
|
||||
import { createSyncClient, ProviderType } from "../utils/cloud";
|
||||
import { corsPath } from "../utils/cors";
|
||||
@@ -100,17 +100,15 @@ export const useSyncStore = createPersistStore(
|
||||
const remoteState = await client.get(config.username);
|
||||
if (!remoteState || remoteState === "") {
|
||||
await client.set(config.username, JSON.stringify(localState));
|
||||
console.log(
|
||||
"[Sync] Remote state is empty, using local state instead.",
|
||||
);
|
||||
return;
|
||||
console.log("[Sync] Remote state is empty, using local state instead.");
|
||||
return
|
||||
} else {
|
||||
const parsedRemoteState = JSON.parse(
|
||||
await client.get(config.username),
|
||||
) as AppState;
|
||||
mergeAppState(localState, parsedRemoteState);
|
||||
setLocalAppState(localState);
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.log("[Sync] failed to get remote state", e);
|
||||
throw e;
|
||||
|
Reference in New Issue
Block a user