diff --git a/lib/features/caching/utils/session_storage_manager.dart b/lib/features/caching/utils/session_storage_manager.dart index 1725b260a..9f0d787f7 100644 --- a/lib/features/caching/utils/session_storage_manager.dart +++ b/lib/features/caching/utils/session_storage_manager.dart @@ -7,11 +7,11 @@ class SessionStorageManager { final html.Storage sessionStorage = html.window.sessionStorage; - Future save(String key, String value) async { - return sessionStorage.addAll({key: value}); + void save(String key, String value) { + sessionStorage.addAll({key: value}); } - Future get(String key) async { + String get(String key) { final entry = sessionStorage .entries .firstWhereOrNull((entry) => entry.key == key); @@ -23,7 +23,7 @@ class SessionStorageManager { } } - Future remove(String key) async { + void remove(String key) { if (sessionStorage.containsKey(key)) { sessionStorage.remove(key); } diff --git a/lib/features/email/data/datasource_impl/email_session_storage_datasource_impl.dart b/lib/features/email/data/datasource_impl/email_session_storage_datasource_impl.dart index 1855dee33..71d9159e3 100644 --- a/lib/features/email/data/datasource_impl/email_session_storage_datasource_impl.dart +++ b/lib/features/email/data/datasource_impl/email_session_storage_datasource_impl.dart @@ -217,8 +217,8 @@ class EmailSessionStorageDatasourceImpl extends EmailDataSource { @override Future storePreviewEMLContentToSessionStorage(EMLPreviewer emlPreviewer) { - return Future.sync(() async { - return await _sessionStorageManager.save( + return Future.sync(() { + return _sessionStorageManager.save( emlPreviewer.id, jsonEncode(emlPreviewer.toJson()), ); @@ -232,8 +232,8 @@ class EmailSessionStorageDatasourceImpl extends EmailDataSource { @override Future getPreviewEMLContentInMemory(String keyStored) { - return Future.sync(() async { - final data = await _sessionStorageManager.get(keyStored); + return Future.sync(() { + final data = _sessionStorageManager.get(keyStored); return EMLPreviewer.fromJson(jsonDecode(data)); }).catchError(_exceptionThrower.throwException); } diff --git a/lib/features/login/data/datasource_impl/authentication_oidc_datasource_impl.dart b/lib/features/login/data/datasource_impl/authentication_oidc_datasource_impl.dart index c644c1624..c0ab80194 100644 --- a/lib/features/login/data/datasource_impl/authentication_oidc_datasource_impl.dart +++ b/lib/features/login/data/datasource_impl/authentication_oidc_datasource_impl.dart @@ -140,8 +140,8 @@ class AuthenticationOIDCDataSourceImpl extends AuthenticationOIDCDataSource { @override Future getAuthenticationInfo() { - return Future.sync(() async { - return await _sessionStorageManager.get( + return Future.sync(() { + return _sessionStorageManager.get( OIDCConstant.authResponseKey, ); }).catchError(_cacheExceptionThrower.throwException); @@ -156,8 +156,8 @@ class AuthenticationOIDCDataSourceImpl extends AuthenticationOIDCDataSource { @override Future removeAuthDestinationUrl() { - return Future.sync(() async { - return await _sessionStorageManager.remove( + return Future.sync(() { + return _sessionStorageManager.remove( LoginConstants.AUTH_DESTINATION_KEY, ); }).catchError(_cacheExceptionThrower.throwException);