wip: refactor
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
use crate::{constants::IMAGE_SERVICE, get_client, states::app::AppRegistry};
|
||||
use crate::{get_client, states::app::AppRegistry};
|
||||
use common::constants::IMAGE_SERVICE;
|
||||
use gpui::prelude::FluentBuilder;
|
||||
use gpui::{
|
||||
actions, img, Context, IntoElement, Model, ObjectFit, ParentElement, Render, Styled,
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
use crate::{
|
||||
use async_utility::task::spawn;
|
||||
use common::{
|
||||
constants::IMAGE_SERVICE,
|
||||
get_client,
|
||||
states::chat::room::Room,
|
||||
utils::{compare, message_time, nip96_upload},
|
||||
};
|
||||
use async_utility::task::spawn;
|
||||
use gpui::{
|
||||
div, img, list, px, white, AnyElement, AppContext, Context, EventEmitter, Flatten, FocusHandle,
|
||||
FocusableView, InteractiveElement, IntoElement, ListAlignment, ListState, Model, ObjectFit,
|
||||
@@ -29,6 +27,8 @@ use ui::{
|
||||
v_flex, ContextModal, Icon, IconName, Sizable,
|
||||
};
|
||||
|
||||
use crate::{get_client, states::chat::room::Room};
|
||||
|
||||
mod message;
|
||||
|
||||
#[derive(Clone)]
|
||||
@@ -363,7 +363,9 @@ impl ChatPanel {
|
||||
let (tx, rx) = oneshot::channel::<Url>();
|
||||
|
||||
spawn(async move {
|
||||
if let Ok(url) = nip96_upload(file_data).await {
|
||||
let client = get_client();
|
||||
|
||||
if let Ok(url) = nip96_upload(client, file_data).await {
|
||||
_ = tx.send(url);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
use crate::{constants::KEYRING_SERVICE, get_client, states::app::AppRegistry};
|
||||
use common::constants::KEYRING_SERVICE;
|
||||
use gpui::{div, IntoElement, ParentElement, Render, Styled, View, ViewContext, VisualContext};
|
||||
use nostr_sdk::prelude::*;
|
||||
use ui::input::{InputEvent, TextInput};
|
||||
|
||||
use crate::{get_client, states::app::AppRegistry};
|
||||
|
||||
pub struct Onboarding {
|
||||
input: View<TextInput>,
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@ use crate::{
|
||||
app::AppRegistry,
|
||||
chat::room::{Member, Room},
|
||||
},
|
||||
utils::{random_name, room_hash},
|
||||
};
|
||||
use common::utils::{random_name, room_hash};
|
||||
use gpui::{
|
||||
div, img, impl_internal_actions, px, uniform_list, Context, FocusHandle, InteractiveElement,
|
||||
IntoElement, Model, ParentElement, Render, SharedString, StatefulInteractiveElement, Styled,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
use crate::{
|
||||
states::chat::ChatRegistry,
|
||||
utils::message_ago,
|
||||
views::app::{AddPanel, PanelKind},
|
||||
};
|
||||
use common::utils::message_ago;
|
||||
use gpui::{
|
||||
div, img, percentage, prelude::FluentBuilder, px, InteractiveElement, IntoElement,
|
||||
ParentElement, Render, SharedString, StatefulInteractiveElement, Styled, ViewContext,
|
||||
|
||||
Reference in New Issue
Block a user