Make it run in wasm
This commit is contained in:
@ -2,7 +2,6 @@ use std::{
|
||||
fs,
|
||||
path::PathBuf,
|
||||
sync::{Arc, mpsc},
|
||||
thread,
|
||||
};
|
||||
|
||||
use crate::{file_editor::FileEditor, preferences::Preferences, util::GuiSender};
|
||||
@ -204,9 +203,10 @@ impl eframe::App for App {
|
||||
self.open_tab(Tab::File(file));
|
||||
}
|
||||
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
if ui.button("Open File").clicked() {
|
||||
let actions_tx = self.actions_tx(ui.ctx());
|
||||
thread::spawn(move || {
|
||||
std::thread::spawn(move || {
|
||||
let file = rfd::FileDialog::new().pick_file();
|
||||
|
||||
let Some(file_path) = file else { return };
|
||||
@ -263,6 +263,7 @@ impl eframe::App for App {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
if ui
|
||||
.add_enabled(open_file.is_some(), Button::new("Save As"))
|
||||
.clicked()
|
||||
|
||||
Reference in New Issue
Block a user