🎨 更新版本后自动打开用户指南 Fix https://github.com/siyuan-note/siyuan/issues/7469

This commit is contained in:
Liang Ding 2023-02-24 12:49:49 +08:00
parent 1069d245af
commit 0b7598df3b
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
6 changed files with 8 additions and 10 deletions

View file

@ -128,7 +128,7 @@ export const initFramework = () => {
closePanel(); closePanel();
}); });
initEditorName(); initEditorName();
if (window.siyuan.config.newbie) { if (window.siyuan.config.openHelp) {
mountHelp(); mountHelp();
} }
const transactionTipElement = document.getElementById("transactionTip"); const transactionTipElement = document.getElementById("transactionTip");

View file

@ -413,7 +413,7 @@ declare interface IConfig {
api: { api: {
token: string token: string
} }
newbie: boolean openHelp: boolean
system: { system: {
networkProxy: { networkProxy: {
host: string host: string

View file

@ -176,7 +176,7 @@ export const onGetConfig = (isStart: boolean) => {
resizeDrag(); resizeDrag();
}, 200); }, 200);
}); });
if (window.siyuan.config.newbie) { if (window.siyuan.config.openHelp) {
mountHelp(); mountHelp();
} }
addGA(); addGA();

View file

@ -70,7 +70,7 @@ type AppConf struct {
Stat *conf.Stat `json:"stat"` // 统计 Stat *conf.Stat `json:"stat"` // 统计
Api *conf.API `json:"api"` // API Api *conf.API `json:"api"` // API
Repo *conf.Repo `json:"repo"` // 数据仓库 Repo *conf.Repo `json:"repo"` // 数据仓库
Newbie bool `json:"newbie"` // 是否是安装后第一次启动 OpenHelp bool `json:"openHelp"` // 启动后是否需要打开用户指南
} }
func InitConf() { func InitConf() {
@ -211,7 +211,9 @@ func InitConf() {
} }
if nil == Conf.System { if nil == Conf.System {
Conf.System = conf.NewSystem() Conf.System = conf.NewSystem()
Conf.OpenHelp = true
} else { } else {
Conf.OpenHelp = Conf.System.KernelVersion != util.Ver
Conf.System.KernelVersion = util.Ver Conf.System.KernelVersion = util.Ver
Conf.System.IsInsider = util.IsInsider Conf.System.IsInsider = util.IsInsider
} }
@ -237,7 +239,6 @@ func InitConf() {
} }
Conf.System.OS = runtime.GOOS Conf.System.OS = runtime.GOOS
Conf.System.OSPlatform, _ = util.GetOSPlatform() Conf.System.OSPlatform, _ = util.GetOSPlatform()
Conf.Newbie = util.IsNewbie
if "" != Conf.UserData { if "" != Conf.UserData {
Conf.User = loadUserFromConf() Conf.User = loadUserFromConf()

View file

@ -162,8 +162,8 @@ func Mount(boxID string) (alreadyMount bool, err error) {
box.SaveConf(boxConf) box.SaveConf(boxConf)
} }
if Conf.Newbie { if Conf.OpenHelp {
Conf.Newbie = false Conf.OpenHelp = false
Conf.Save() Conf.Save()
} }

View file

@ -180,15 +180,12 @@ var (
SnippetsPath string // 数据目录下的 snippets/ 路径 SnippetsPath string // 数据目录下的 snippets/ 路径
UIProcessIDs = sync.Map{} // UI 进程 ID UIProcessIDs = sync.Map{} // UI 进程 ID
IsNewbie bool // 是否是第一次安装
) )
func initWorkspaceDir(workspaceArg string) { func initWorkspaceDir(workspaceArg string) {
userHomeConfDir := filepath.Join(HomeDir, ".config", "siyuan") userHomeConfDir := filepath.Join(HomeDir, ".config", "siyuan")
workspaceConf := filepath.Join(userHomeConfDir, "workspace.json") workspaceConf := filepath.Join(userHomeConfDir, "workspace.json")
if !gulu.File.IsExist(workspaceConf) { if !gulu.File.IsExist(workspaceConf) {
IsNewbie = ContainerStd == Container // 只有桌面端需要设置新手标识,前端自动挂载帮助文档
if err := os.MkdirAll(userHomeConfDir, 0755); nil != err && !os.IsExist(err) { if err := os.MkdirAll(userHomeConfDir, 0755); nil != err && !os.IsExist(err) {
log.Printf("create user home conf folder [%s] failed: %s", userHomeConfDir, err) log.Printf("create user home conf folder [%s] failed: %s", userHomeConfDir, err)
os.Exit(ExitCodeCreateConfDirErr) os.Exit(ExitCodeCreateConfDirErr)