From bd07bdc2c3df031d5a04d3eebade5d7fc7672600 Mon Sep 17 00:00:00 2001 From: molvqingtai Date: Tue, 29 Oct 2024 22:17:16 +0800 Subject: [PATCH] fix: incompatibility with old data causes app to crash --- src/constants/config.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/constants/config.ts b/src/constants/config.ts index 82c059c..1d10a7c 100644 --- a/src/constants/config.ts +++ b/src/constants/config.ts @@ -1,3 +1,4 @@ +import { version } from '@/../package.json' // https://www.webfx.com/tools/emoji-cheat-sheet/ export const EMOJI_LIST = [ @@ -185,12 +186,12 @@ export const BREAKPOINTS = { export const MESSAGE_MAX_LENGTH = 500 as const -export const STORAGE_NAME = 'WEB_CHAT' as const - -export const MESSAGE_LIST_STORAGE_KEY = 'WEB_CHAT_MESSAGE_LIST' as const +export const STORAGE_NAME = `WEB_CHAT_${version}` as const export const USER_INFO_STORAGE_KEY = 'WEB_CHAT_USER_INFO' as const +export const MESSAGE_LIST_STORAGE_KEY = 'WEB_CHAT_MESSAGE_LIST' as const + export const APP_STATUS_STORAGE_KEY = 'WEB_CHAT_APP_STATUS' as const /** * In chrome storage.sync, each key-value pair supports a maximum storage of 8kb