-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Widget Kit Refreshing Bug #778
Fix Widget Kit Refreshing Bug #778
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good! There's one change I'd like to see about how a new apiService object is constructed, but otherwise 🚀 .
Also, I'm not sure why the CI is failing. Tests are passing, so 🤷 . I'll get this merged once your change is in and we can worry about CI later.
@@ -129,6 +129,15 @@ open class CoreApplication: NSObject, | |||
self.apiService = RESTAPIService(APIServiceConfiguration(baseURL: region.OBABaseURL, apiKey: config.apiKey, uuid: userUUID, appVersion: config.appVersion, regionIdentifier: region.regionIdentifier)) | |||
} | |||
|
|||
public func getNewRefreshedRESTAPIService() -> RESTAPIService? { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete this
func loadData() async { | ||
arrDepDic = [:] | ||
|
||
guard let apiService = app.getNewRefreshedRESTAPIService() else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
call app.refreshServices()
and then use app.apiService
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done ✅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great work 🚀
Note:
The problem was that RestAPIServices wasn’t refreshing properly when changing to new region due to some reasons. I added a method, getRefreshedAPIService, to fix this issue efficiently FOR NOW :)
Preview:
e036f0c1d9b84114bce4c299642b8c0c.MP4