Skip to content

Commit

Permalink
feat: tvOS add support refresh via play/pause key
Browse files Browse the repository at this point in the history
  • Loading branch information
isaced committed Aug 28, 2023
1 parent 41bfb54 commit 7506d27
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions V2exOSTV/Views/TopicListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ struct TopicListView: View {
await loadData()
}
}
.onPlayPauseCommand {
Task {
topics = nil
page = 1
selectedTopic = nil
await loadData()
}
}
}

func loadData(page: Int = 1) async {
Expand All @@ -49,6 +57,7 @@ struct TopicListView: View {
}

do {
print("load Data...")
var topics: [V2Topic]?

if nodeName == NodeNameAll {
Expand Down

0 comments on commit 7506d27

Please sign in to comment.