package com.adealink.weparty.webview.datasource.local

import android.content.Context
import com.adealink.frame.log.Log
import com.adealink.frame.storage.sp.TypeDelegationPrefs
import com.adealink.frame.util.AppUtil
import com.adealink.weparty.module.profile.ProfileModule
import com.adealink.weparty.storage.PREF_WEB
import com.adealink.weparty.webview.constant.TAG_WEB_VIEW


object WebLocalService : TypeDelegationPrefs(
    prefs = {
        AppUtil.appContext.getSharedPreferences(PREF_WEB, Context.MODE_PRIVATE)
    },
    userId = {
        ProfileModule.getMyUid()
    }
) {

    var webVersion: String by PrefKey("key_web_version", "")

    var offlineH5UrlsJson: String by PrefKey("key_offline_urls_json", "")

    fun initWebVersion() {
        Log.i(TAG_WEB_VIEW, "initWebVersion, webVersion:${webVersion}")
        if (webVersion.isEmpty()) {
            webVersion = "1.0.0"
        }
    }


}