public LanguageManagerService(ILanguageService languageService, IJsInteropService jsInteropService,
                               ILocalStorageManagerService localStorageManagerService)
 {
     _languageService            = languageService;
     _jsInteropService           = jsInteropService;
     _localStorageManagerService = localStorageManagerService;
 }
Пример #2
0
        public StorageService(
            ILogger <StorageService> logger, IJsInteropService jsInteropService,
            IFirebaseGoogleAuthService authService, IFirestoreService firestoreService)
        {
            Logger           = logger;
            JSR              = jsInteropService;
            AuthService      = authService;
            FirestoreService = firestoreService;

            AuthService.AuthStateChangedCallback += async(GoogleAuthUser user) =>
            {
                if (user != null)
                {
                    // signed in
                    if (!_subscribedForDocUpdates)
                    {
                        FirestoreOperationResult <UserDocument> res =
                            await FirestoreService.SubscribeForDocumentUpdates <UserDocument>(
                                "users", user.uid, async document =>
                        {
                            // Update local storage with firestore content
                            UserDocument userDoc = document as UserDocument;
                            if (userDoc.TrackedTimezoneIds == null || userDoc.TrackedTimezoneIds.Count == 0)
                            {
                                await DeleteAllTrackedTimezones();
                            }
                            else
                            {
                                await SaveTrackedTimezones(userDoc.TrackedTimezoneIds);
                            }

                            TrackedTimezoneListUpdateCallback.Invoke();
                        });

                        if (res.Success)
                        {
                            Logger.LogInformation("Subscribed for timezone list updates.");
                            _subscribedForDocUpdates = true;
                        }
                        else
                        {
                            Logger.LogError("Failed to subscribe for timezone list updates.");
                        }
                    }
                }
            };
        }
Пример #3
0
 public ScrollService(IJsInteropService jsInteropService)
 {
     _jsInteropService = jsInteropService;
 }
Пример #4
0
 public NavigationService(NavigationManager navigationManager, IJsInteropService jsInteropService)
 {
     _navigationManager = navigationManager;
     _jsInteropService  = jsInteropService;
 }