🎨 更新版本后自动打开用户指南 Fix https://github.com/siyuan-note/siyuan/issues/7469
This commit is contained in:
parent
1069d245af
commit
0b7598df3b
6 changed files with 8 additions and 10 deletions
|
@ -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");
|
||||
|
|
2
app/src/types/index.d.ts
vendored
2
app/src/types/index.d.ts
vendored
|
@ -413,7 +413,7 @@ declare interface IConfig {
|
|||
api: {
|
||||
token: string
|
||||
}
|
||||
newbie: boolean
|
||||
openHelp: boolean
|
||||
system: {
|
||||
networkProxy: {
|
||||
host: string
|
||||
|
|
|
@ -176,7 +176,7 @@ export const onGetConfig = (isStart: boolean) => {
|
|||
resizeDrag();
|
||||
}, 200);
|
||||
});
|
||||
if (window.siyuan.config.newbie) {
|
||||
if (window.siyuan.config.openHelp) {
|
||||
mountHelp();
|
||||
}
|
||||
addGA();
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue