Check if file exists instead of explicitly checking for symlink

This commit is contained in:
Rokosun 2023-11-07 08:00:48 +01:00
parent e5dda337ad
commit 5ebe7e33eb

View File

@ -145,7 +145,7 @@ method view(app: AppState): Widget =
Label {.hAlign: AlignEnd.}: Label {.hAlign: AlignEnd.}:
text = "Open this Welcome Screen on every boot" text = "Open this Welcome Screen on every boot"
Switch {.vAlign: AlignCenter, hAlign: AlignStart.}: Switch {.vAlign: AlignCenter, hAlign: AlignStart.}:
state = if symlinkExists(autostartSymlinkPath): true else: false state = if fileExists(autostartSymlinkPath): true else: false
proc changed(state: bool) = proc changed(state: bool) =
if state == true: if state == true:
if not symlinkExists(autostartSymlinkPath): if not symlinkExists(autostartSymlinkPath):