//
//  GVar.swift
//  WOKA
//
//  Created by Bilal on 26/04/2024.
//

import Foundation

extension K{
    
    struct GVar{
//        static var localized = K.LocalizedEnum.english
        static var lastOpenTimestamp : Date?
        
        static var reloadMyList = false
        static var topView = TopViewEnum.theme1
        
        static var myListSoftReload = false
        
        static var reloadMyListAudioBooks = false
        static var reloadKaraoke = false
        static var reloadGames = false
        static var reloadHindiWebseries = false
        static var reloadEnglishWebseries = false
        
        static var reloadMyListAll = 0 // 0 - null, 1 - add , 2- remove
        static var reloadMyListAllID = 0
        
        static var reloadContinueKaraoke = false
        static var reloadContinueAudioBooks = false
        static var reloadContinueWebSeries = false
        
        /*
         Username selected from forgot username shall be stored here
         */
        static var selectedUsername : String? = nil
        
        /*
         this will handle ad timing for games
         */
        static var adTimeStamp : Date? = nil

        /*
         This will handle sync timing for sending data from coredata.
         Basically keeping this to do the sync every hour if data is founnd
         */
        static var lastDataSync : Date? = nil

        /*
         User Skipped update
         */
        
        static var skippedUpdate : Bool? = nil
        
        /*
         Reset to defaults at the time of logout
         */
        static func resetToDefault() {
            lastOpenTimestamp = nil
            reloadMyList = false
            topView = TopViewEnum.theme1
            myListSoftReload = false
            reloadMyListAudioBooks = false
            reloadKaraoke = false
            reloadGames = false
            reloadHindiWebseries = false
            reloadEnglishWebseries = false
            reloadMyListAll = 0
            reloadMyListAllID = 0
            reloadContinueKaraoke = false
            reloadContinueAudioBooks = false
            reloadContinueWebSeries = false
            selectedUsername = nil
            adTimeStamp = nil
            lastDataSync = nil
            skippedUpdate = nil
        }
    }
}
