Skip to content

Commit

Permalink
gut extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
sdwoodbury committed Oct 19, 2023
1 parent 75009aa commit 631d842
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 38 deletions.
26 changes: 0 additions & 26 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ members = [
"ui",
"icons",
"common",
"extensions",
"native_extensions/emoji_selector",
]

resolver = "2"
Expand Down
2 changes: 1 addition & 1 deletion ui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ raw-window-handle = { workspace = true }
dioxus-core = { workspace = true }
kit = { workspace = true }
common = { workspace = true }
extensions = { workspace = true }
# extensions = { workspace = true }
tokio-util = { workspace = true }
arboard = { workspace = true }
humansize = { workspace = true }
Expand Down
3 changes: 2 additions & 1 deletion ui/src/layouts/chats/presentation/chatbar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,8 @@ pub fn get_chatbar<'a>(cx: &'a Scoped<'a, ChatProps>) -> Element<'a> {
let ext_renders = extensions
.values()
.filter(|(is_enabled, ext)| {
ext.details().location == extensions::Location::Chatbar && *is_enabled
/*ext.details().location == extensions::Location::Chatbar && *is_enabled*/
false
})
.map(|(_, ext)| ext.render(cx.scope))
.collect::<Vec<_>>();
Expand Down
2 changes: 1 addition & 1 deletion ui/src/layouts/chats/presentation/sidebar/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ pub fn Sidebar(cx: Scope<SidebarProps>) -> Element {
let extensions = &state.read().ui.extensions;
let ext_renders = extensions
.values()
.filter(|(_, ext)| ext.details().location == extensions::Location::Sidebar)
.filter(|(_, ext)|/*ext.details().location == extensions::Location::Sidebar*/ false)
.map(|(_, ext)| rsx!(ext.render(cx.scope)))
.collect::<Vec<_>>();
let search_typed_chars = use_ref(cx, String::new);
Expand Down
14 changes: 7 additions & 7 deletions ui/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use dioxus_desktop::{
use_window,
};
use dioxus_router::prelude::{use_navigator, Outlet, Routable, Router};
use extensions::UplinkExtension;
// use extensions::UplinkExtension;
use futures::channel::oneshot;
use futures::StreamExt;
use kit::components::context_menu::{ContextItem, ContextMenu};
Expand Down Expand Up @@ -566,14 +566,14 @@ fn use_app_coroutines(cx: &ScopeState) -> Option<()> {
}

// this is technically bad because it blocks the async runtime
match get_extensions() {
/*match get_extensions() {
Ok(ext) => {
state.write().mutate(Action::RegisterExtensions(ext));
}
Err(e) => {
log::error!("failed to get extensions: {e}");
}
}
}*/
log::debug!(
"Loaded {} extensions.",
state.read().ui.extensions.values().count()
Expand Down Expand Up @@ -679,14 +679,14 @@ fn use_app_coroutines(cx: &ScopeState) -> Option<()> {
};

log::debug!("{event:?}");
match get_extensions() {
/*match get_extensions() {
Ok(ext) => {
state.write().mutate(Action::RegisterExtensions(ext));
}
Err(e) => {
log::error!("failed to get extensions: {e}");
}
}
}*/
}
}
});
Expand Down Expand Up @@ -964,7 +964,7 @@ fn use_router_notification_listener(cx: &ScopeState) -> Option<()> {
Some(())
}

fn get_extensions() -> Result<HashMap<String, UplinkExtension>, Box<dyn std::error::Error>> {
/*fn get_extensions() -> Result<HashMap<String, UplinkExtension>, Box<dyn std::error::Error>> {
fs::create_dir_all(&STATIC_ARGS.extensions_path)?;
let mut extensions = HashMap::new();
Expand Down Expand Up @@ -1003,7 +1003,7 @@ fn get_extensions() -> Result<HashMap<String, UplinkExtension>, Box<dyn std::err
}
Ok(extensions)
}
}*/

fn scaled_window_size(
inner: PhysicalSize<u32>,
Expand Down

0 comments on commit 631d842

Please sign in to comment.