Performance improvements

This commit is contained in:
Arkadiusz Fal
2022-08-23 23:14:13 +02:00
parent 642354fc8e
commit 9ca905e5c7
5 changed files with 33 additions and 44 deletions

View File

@@ -27,20 +27,25 @@ struct ShareButton: View {
private var instanceActions: some View {
Group {
if let url = player.playerAPI.shareURL(contentItem) {
Button(labelForShareURL(accounts.app.name)) {
Button(labelForShareURL(accounts.app.name)) {
if let url = player.playerAPI.shareURL(contentItem) {
shareAction(url)
} else {
navigation.presentAlert(
title: "Could not create share link",
message: "For custom locations you can configure Frontend URL in Locations settings"
)
}
}
if contentItemIsPlayerCurrentVideo {
Button(labelForShareURL(accounts.app.name, withTime: true)) {
shareAction(
player.playerAPI.shareURL(
contentItem,
time: player.backend.currentTime
)!
)
}
if contentItemIsPlayerCurrentVideo {
Button(labelForShareURL(accounts.app.name, withTime: true)) {
shareAction(
player.playerAPI.shareURL(
contentItem,
time: player.backend.currentTime
)!
)
}
}
}