Skip to content

Commit

Permalink
fix: Disable recent files on web build since they can't work there
Browse files Browse the repository at this point in the history
  • Loading branch information
WerWolv committed Jan 1, 2025
1 parent 9f9c5ab commit 0e4d949
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions plugins/builtin/source/content/recent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,10 @@ namespace hex::plugin::builtin::recent {
}

void addMenuItems() {
#if defined(OS_WEB)
return;
#endif

ContentRegistry::Interface::addMenuItemSubMenu({ "hex.builtin.menu.file" }, 1200, [] {
if (ImGui::BeginMenuEx("hex.builtin.menu.file.open_recent"_lang, ICON_VS_ARCHIVE, !recent::s_recentEntriesUpdating && !s_recentEntries.empty())) {
// Copy to avoid changing list while iteration
Expand Down
5 changes: 4 additions & 1 deletion plugins/builtin/source/content/welcome_screen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,10 @@ namespace hex::plugin::builtin {

// Draw recent entries
ImGui::Dummy({});
recent::draw();

#if !defined(OS_WEB)
recent::draw();
#endif

ImGui::TableNextRow(ImGuiTableRowFlags_None, ImGui::GetTextLineHeightWithSpacing() * 6);
ImGui::TableNextColumn();
Expand Down

0 comments on commit 0e4d949

Please sign in to comment.