Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd2856a6

Browse files
committed
[TF-1709] fix iOS 16
1 parentc18ca6a commitd2856a6

File tree

7 files changed

+17
-17
lines changed

7 files changed

+17
-17
lines changed

‎TwoFAS/TwoFASWidget/AppIntent/AppIntentProvider.swift‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import TimeVerification
2929

3030
@available(iOS17.0, macOS14.0, watchOS10.0,*)
3131
structAppIntentProvider:AppIntentTimelineProvider{
32-
privateletdefaults=UserDefaults.standard
32+
privateletdefaults=UserDefaults(suiteName:"group.twofas.com")
3333
privateletcalendar=Calendar.current
3434
typealiasIntent=SelectService
3535

@@ -204,19 +204,18 @@ struct AppIntentProvider: AppIntentTimelineProvider {
204204
@available(iOS17.0, macOS14.0, watchOS10.0,*)
205205
extensionAppIntentProvider{
206206
privatefunc clearDefaults(){
207-
defaults.removeObject(forKey:CommonKeys.tapDate)
208-
defaults.removeObject(forKey:CommonKeys.tapSecret)
209-
defaults.synchronize()
207+
defaults?.removeObject(forKey:CommonKeys.tapDate)
208+
defaults?.removeObject(forKey:CommonKeys.tapSecret)
209+
defaults?.synchronize()
210210
}
211211

212212
privatefunc handleClickableWidgets()->(validSecret:Secret?, secondsLeft:Int){
213213
letvalidSecret:Secret?
214214
letsecondsLeft:Int
215215

216-
letdateValue= defaults.double(forKey:"tapDate")
217-
if !dateValue.isZero{
216+
iflet dateValue= defaults?.double(forKey:"tapDate"), !dateValue.isZero{
218217
letduration=Date().timeIntervalSince1970- dateValue
219-
if duration<60.0,let storedSecret= defaults.string(forKey:"tapSecret"){
218+
if duration<60.0,let storedSecret= defaults?.string(forKey:"tapSecret"){
220219
secondsLeft=60- Int(duration)
221220
validSecret= storedSecret
222221
}else{

‎TwoFAS/TwoFASWidget/AppIntent/RevealTokenAppIntent.swift‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ struct RevealTokenAppIntent: AppIntent {
3939

4040
@MainActor
4141
func perform()asyncthrows->someIntentResult{
42-
letdefaults=UserDefaults.standard
43-
defaults.set(Date().timeIntervalSince1970, forKey:CommonKeys.tapDate)
44-
defaults.set(secret, forKey:CommonKeys.tapSecret)
45-
defaults.synchronize()
42+
letdefaults=UserDefaults(suiteName:"group.twofas.com")
43+
defaults?.set(Date().timeIntervalSince1970, forKey:CommonKeys.tapDate)
44+
defaults?.set(secret, forKey:CommonKeys.tapSecret)
45+
defaults?.synchronize()
4646

4747
return.result()
4848
}

‎TwoFAS/TwoFASWidget/AppIntent/ServiceAppEntity.swift‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ struct ServiceAppEntity: AppEntity {
3535
SelectedItems.list= identifiers
3636
returnAccessManager.serviceHandler.listAll(search:nil, exclude:[])
3737
.flatMap({ $0.services})
38-
.filter({ identifiers.contains($0.serviceID)&& $0.period!=.period10})
38+
.filter({ identifiers.contains($0.serviceID)})
3939
.map({ servicein
4040
ServiceAppEntity(
4141
id: service.serviceID,
@@ -57,7 +57,7 @@ struct ServiceAppEntity: AppEntity {
5757
letall:[WidgetCategory]=AccessManager.serviceHandler.listAll(search:nil, exclude:[])
5858
letsections= all.map({ category->ItemSection<ServiceAppEntity>in
5959
letservices:[Item]= category.services
60-
.filter({ !SelectedItems.list.contains($0.serviceID)&& $0.period!=.period10})
60+
.filter({ !SelectedItems.list.contains($0.serviceID)})
6161
.map({ servicein
6262
leticon= service.icon.pngData()
6363
letimage:DisplayRepresentation.Image?={

‎TwoFAS/TwoFASWidget/Provider.swift‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ struct Provider: IntentTimelineProvider {
8484

8585
letselectedServices= configuration.service??[]
8686
letcurrentServices= serviceHandler.listServices(with: selectedServices.compactMap{ $0.secret})
87-
.filter({ $0.period!=.period10})
8887

8988
varentries:[CodeEntry]=[]
9089

‎TwoFAS/TwoFASWidget/TwoFASWidget.swift‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ struct TwoFASWidgetEntryView: View {
4747
}
4848
.frame(maxWidth:.infinity, maxHeight:.infinity, alignment:.leading)
4949
.padding(4)
50+
.addWidgetContentMargins()
5051
.widgetBackground(backgroundView:Color.accent)
5152
}
5253

@@ -76,6 +77,7 @@ struct TwoFASWidgetEntryView: View {
7677
}
7778
}
7879
.widgetBackground(backgroundView:Color.widgetBackground)
80+
.addWidgetContentMargins()
7981
}
8082
}
8183
}

‎TwoFAS/TwoFASWidget/TwoFASWidgetSquareView.swift‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ struct TwoFASWidgetSquareView: View {
9494
.foregroundStyle(Color.clear)
9595
.frame(maxWidth:.infinity, maxHeight:.infinity)
9696
}
97-
}elseif kind==.singleEntryHidden,let secret= entry?.data.secret{
98-
RevealTokenIntentButton(secret: secret){
97+
}elseif kind==.singleEntryHidden{
98+
RevealTokenIntentButton(secret:entryData.secret){
9999
RevealTokenOverlayView()
100100
}
101101
}

‎TwoFAS/TwoFASWidget/WidgetContentMargins.swift‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ struct WidgetContentMarginsModifier: ViewModifier {
2929
}
3030

3131
extensionView{
32-
@ViewBuilderfunc addWidgetContentMargins(standard:Double=8.0)->someView{
32+
@ViewBuilderfunc addWidgetContentMargins(standard:Double=16.0)->someView{
3333
if #available(iOS17,*){
3434
self
3535
}else{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp