package com.kaixed.kchat.database;

import static com.kaixed.kchat.utils.Constants.MMKV_USER_SESSION;

import com.tencent.mmkv.MMKV;

public class UserManager {

    private static final String USERNAME_KEY = "username";
    private static UserManager instance;
    private String username;

    private UserManager() {
        MMKV mmkv = MMKV.mmkvWithID(MMKV_USER_SESSION);
        username = mmkv.getString(USERNAME_KEY, null);
    }

    public static synchronized UserManager getInstance() {
        if (instance == null) {
            instance = new UserManager();
        }
        return instance;
    }

    public String getUsername() {
        return username;
    }
}