mirror of
https://github.com/immich-app/immich
synced 2025-10-17 18:19:27 +00:00
feat(mobile): use custom headers when connecting in widget (#20666)
* feat(mobile): use custom headers when connecting in widget * delete log in android widget * chore: code review changes
This commit is contained in:
parent
7a7843467c
commit
13d43e193e
6 changed files with 58 additions and 8 deletions
|
|
@ -11,10 +11,11 @@ class WidgetService {
|
|||
|
||||
const WidgetService(this._repository);
|
||||
|
||||
Future<void> writeCredentials(String serverURL, String sessionKey) async {
|
||||
Future<void> writeCredentials(String serverURL, String sessionKey, String customHeaders) async {
|
||||
await _repository.setAppGroupId(appShareGroupId);
|
||||
await _repository.saveData(kWidgetServerEndpoint, serverURL);
|
||||
await _repository.saveData(kWidgetAuthToken, sessionKey);
|
||||
await _repository.saveData(kWidgetCustomHeaders, customHeaders);
|
||||
|
||||
// wait 3 seconds to ensure the widget is updated, dont block
|
||||
Future.delayed(const Duration(seconds: 3), refreshWidgets);
|
||||
|
|
@ -24,6 +25,7 @@ class WidgetService {
|
|||
await _repository.setAppGroupId(appShareGroupId);
|
||||
await _repository.saveData(kWidgetServerEndpoint, "");
|
||||
await _repository.saveData(kWidgetAuthToken, "");
|
||||
await _repository.saveData(kWidgetCustomHeaders, "");
|
||||
|
||||
// wait 3 seconds to ensure the widget is updated, dont block
|
||||
Future.delayed(const Duration(seconds: 3), refreshWidgets);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue