chore: set wizard not display after read

This commit is contained in:
CMK 2021-09-16 17:03:24 +08:00
parent 2fdd5e23c7
commit f3789a525c
1 changed files with 11 additions and 1 deletions

View File

@ -56,6 +56,13 @@ extension MainTabBarController.Wizard {
return "Switch between multiple accounts by holding the profile button." return "Switch between multiple accounts by holding the profile button."
} }
} }
func markAsRead() {
switch self {
case .multipleAccountSwitch:
UserDefaults.shared.didShowMultipleAccountSwitchWizard = true
}
}
} }
} }
@ -89,8 +96,12 @@ extension MainTabBarController.Wizard {
return return
} }
// prepare for reuse
prepareForReuse() prepareForReuse()
// set wizard item read
item.markAsRead()
// add spotlight // add spotlight
let spotlight = delegate.spotlight(item: item) let spotlight = delegate.spotlight(item: item)
let maskLayer = CAShapeLayer() let maskLayer = CAShapeLayer()
@ -118,7 +129,6 @@ extension MainTabBarController.Wizard {
@objc private func backgroundTapGestureRecognizerHandler(_ sender: UITapGestureRecognizer) { @objc private func backgroundTapGestureRecognizerHandler(_ sender: UITapGestureRecognizer) {
logger.log(level: .debug, "\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public)") logger.log(level: .debug, "\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public)")
// TODO: toggle current item preference flag
consume() consume()
} }
} }