mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-14 17:23:25 +01:00
fix: remove duplicate isSideStore checks with a StoreApp extension
This commit is contained in:
15
AltStore/Extensions/StoreApp+SideStore.swift
Normal file
15
AltStore/Extensions/StoreApp+SideStore.swift
Normal file
@@ -0,0 +1,15 @@
|
||||
//
|
||||
// StoreApp+SideStore.swift
|
||||
// SideStore
|
||||
//
|
||||
// Created by naturecodevoid on 4/9/23.
|
||||
// Copyright © 2023 SideStore. All rights reserved.
|
||||
//
|
||||
|
||||
import AltStoreCore
|
||||
|
||||
extension StoreApp {
|
||||
var isSideStore: Bool {
|
||||
self.bundleIdentifier == Bundle.Info.appbundleIdentifier
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,7 @@ struct AppRowView: View {
|
||||
|
||||
var body: some View {
|
||||
HStack(alignment: .center, spacing: 12) {
|
||||
AppIconView(iconUrl: storeApp?.iconURL, isSideStore: storeApp?.bundleIdentifier == Bundle.Info.appbundleIdentifier)
|
||||
AppIconView(iconUrl: storeApp?.iconURL, isSideStore: storeApp?.isSideStore)
|
||||
|
||||
VStack(alignment: .leading, spacing: 2) {
|
||||
Text(app.name)
|
||||
|
||||
@@ -63,7 +63,7 @@ struct AppDetailView: View {
|
||||
ToolbarItemGroup(placement: .principal) {
|
||||
HStack {
|
||||
Spacer()
|
||||
AppIconView(iconUrl: storeApp.iconURL, isSideStore: storeApp.bundleIdentifier == Bundle.Info.appbundleIdentifier, size: 24)
|
||||
AppIconView(iconUrl: storeApp.iconURL, isSideStore: storeApp.isSideStore, size: 24)
|
||||
Text(storeApp.name)
|
||||
.bold()
|
||||
Spacer()
|
||||
@@ -79,7 +79,7 @@ struct AppDetailView: View {
|
||||
var headerView: some View {
|
||||
ZStack(alignment: .center) {
|
||||
GeometryReader { proxy in
|
||||
AppIconView(iconUrl: storeApp.iconURL, isSideStore: storeApp.bundleIdentifier == Bundle.Info.appbundleIdentifier, size: proxy.frame(in: .global).width)
|
||||
AppIconView(iconUrl: storeApp.iconURL, isSideStore: storeApp.isSideStore, size: proxy.frame(in: .global).width)
|
||||
.blur(radius: headerBlurRadius)
|
||||
.offset(y: min(0, scrollOffset))
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ struct WriteAppReviewView: View {
|
||||
List {
|
||||
// App Information
|
||||
HStack {
|
||||
AppIconView(iconUrl: storeApp.iconURL, isSideStore: storeApp.bundleIdentifier == Bundle.Info.appbundleIdentifier, size: 50)
|
||||
AppIconView(iconUrl: storeApp.iconURL, isSideStore: storeApp.isSideStore size: 50)
|
||||
VStack(alignment: .leading) {
|
||||
Text(storeApp.name)
|
||||
.bold()
|
||||
|
||||
@@ -37,7 +37,7 @@ struct ErrorLogView: View {
|
||||
HStack(alignment: .top) {
|
||||
Group {
|
||||
if let storeApp = error.storeApp {
|
||||
AppIconView(iconUrl: storeApp.iconURL, isSideStore: storeApp.bundleIdentifier == Bundle.Info.appbundleIdentifier, size: 50)
|
||||
AppIconView(iconUrl: storeApp.iconURL, isSideStore: storeApp.isSideStore, size: 50)
|
||||
} else {
|
||||
ZStack {
|
||||
RoundedRectangle(cornerRadius: 50*0.234, style: .continuous)
|
||||
|
||||
Reference in New Issue
Block a user