mirror of
https://github.com/zhigang1992/GitHawk.git
synced 2026-04-15 12:10:33 +08:00
[ADD] Bookmarks per user account (#738)
This commit is contained in:
committed by
Ryan Nystrom
parent
908463a31a
commit
199ce48047
@@ -112,7 +112,17 @@ NewIssueTableViewControllerDelegate {
|
||||
owner: repo.owner,
|
||||
hasIssueEnabled: repo.hasIssuesEnabled
|
||||
)
|
||||
return AlertAction.bookmark(bookmarkModel)
|
||||
let store = BookmarksStore(client.userSession?.token)
|
||||
let isNewBookmark = !store.contains(bookmark: bookmarkModel)
|
||||
return AlertAction.toggleBookmark(isNewBookmark) { _ in
|
||||
if isNewBookmark {
|
||||
store.add(bookmark: bookmarkModel)
|
||||
}
|
||||
else {
|
||||
store.remove(bookmark: bookmarkModel)
|
||||
}
|
||||
Haptic.triggerNotification(.success)
|
||||
}
|
||||
}
|
||||
|
||||
@objc
|
||||
|
||||
Reference in New Issue
Block a user