🎨 更新版本后自动打开用户指南 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();
});
initEditorName();
if (window.siyuan.config.newbie) {
if (window.siyuan.config.openHelp) {
mountHelp();
}
const transactionTipElement = document.getElementById("transactionTip");

View file

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

View file

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

View file

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

View file

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

View file

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