MCPcopy
hub / github.com/chavyleung/scripts / upgradeUserData

Function upgradeUserData

chavy.box.js:1054–1073  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1052}
1053
1054function upgradeUserData() {
1055 const usercfgs = getUserCfgs()
1056 // 如果存在`usercfgs.appsubCaches`则需要升级数据
1057 const isNeedUpgrade = !!usercfgs.appsubCaches
1058 if (isNeedUpgrade) {
1059 // 迁移订阅缓存至独立的持久化空间
1060 $.setjson(usercfgs.appsubCaches, $.KEY_app_subCaches)
1061 // 移除用户偏好中的订阅缓存
1062 delete usercfgs.appsubCaches
1063 usercfgs.appsubs.forEach((sub) => {
1064 delete sub._raw
1065 delete sub.apps
1066 delete sub.isErr
1067 delete sub.updateTime
1068 })
1069 }
1070 if (isNeedUpgrade) {
1071 $.setjson(usercfgs, $.KEY_usercfgs)
1072 }
1073}
1074
1075/**
1076 * 升级备份数据

Callers 1

chavy.box.jsFile · 0.70

Calls 2

getUserCfgsFunction · 0.70
setjsonMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…