fix(avatarcachemanager): avatar saved at wrong path in set_avatar()

m_save_path is empty & ::load() never called when cache folder does not exist.
This commit is contained in:
Shawn Sun
2023-05-11 03:05:59 +08:00
parent 47e26f002d
commit cdc6c080b7

View File

@@ -109,12 +109,13 @@ bool asst::ResourceLoader::load(const std::filesystem::path& path)
} \
}
#define LoadCacheWithoutRet(Config, Dir) \
{ \
auto full_path = UserDir.get() / "cache"_p / Dir; \
if (std::filesystem::exists(full_path)) { \
SingletonHolder<Config>::get_instance().load(full_path); \
} \
#define LoadCacheWithoutRet(Config, Dir) \
{ \
auto full_path = UserDir.get() / "cache"_p / Dir; \
if (!std::filesystem::exists(full_path)) { \
std::filesystem::create_directories(full_path); \
} \
SingletonHolder<Config>::get_instance().load(full_path); \
}
LogTraceFunction;