Improve column management (#221)

* wip: redesign store

* feat: update trending column

* feat: add more functions
This commit is contained in:
雨宮蓮
2024-07-02 12:51:50 +07:00
committed by GitHub
parent ed4f89ff66
commit 8eb01c8bbf
17 changed files with 281 additions and 214 deletions

View File

@@ -1,52 +1,37 @@
[
{
"label": "lZfXLFgPPR4NNrgjlWDxn",
"name": "Newsfeed",
"content": "/newsfeed",
"logo": "",
"cover": "/newsfeed.png",
"coverRetina": "/newsfeed@2x.png",
"author": "Lume",
"description": "Keep up to date with the people you're following."
},
{
"label": "rRtguZwIpd5G8Wt54OTb7",
"name": "Topic",
"content": "/topic",
"logo": "",
"cover": "/foryou.png",
"coverRetina": "/foryou@2x.png",
"author": "Lume",
"description": "Keep up to date with content based on your interests."
},
{
"label": "fve9fk2fVyFWORPBkjd79",
"name": "Group",
"content": "/group",
"logo": "",
"cover": "/group.png",
"coverRetina": "/group@2x.png",
"author": "Lume",
"description": "Focus feeds for people you like."
},
{
"label": "gxtcIbgD8YNPbeI5o92I8",
"name": "Trending",
"content": "/trending/notes",
"logo": "",
"cover": "/trending.png",
"coverRetina": "/trending@2x.png",
"author": "Lume",
"description": "What is trending on Nostr?."
},
{
"label": "GLFm44za8rhJDP04LMr3M",
"name": "Global",
"content": "/global",
"logo": "",
"cover": "/global.png",
"coverRetina": "/global@2x.png",
"author": "Lume",
"description": "All events from connected relays."
}
{
"label": "lZfXLFgPPR4NNrgjlWDxn",
"name": "Local Feeds",
"content": "/newsfeed",
"cover": "/newsfeed.png",
"coverRetina": "/newsfeed@2x.png"
},
{
"label": "GLFm44za8rhJDP04LMr3M",
"name": "Global Feeds",
"content": "/global",
"cover": "/global.png",
"coverRetina": "/global@2x.png"
},
{
"label": "fve9fk2fVyFWORPBkjd79",
"name": "Group Feeds",
"content": "/group",
"cover": "/group.png",
"coverRetina": "/group@2x.png"
},
{
"label": "rRtguZwIpd5G8Wt54OTb7",
"name": "Topic",
"content": "/topic",
"cover": "/foryou.png",
"coverRetina": "/foryou@2x.png"
},
{
"label": "gxtcIbgD8YNPbeI5o92I8",
"name": "Trending",
"content": "/trending/notes",
"cover": "/trending.png",
"coverRetina": "/trending@2x.png"
}
]

View File

@@ -138,6 +138,21 @@ pub fn resize_column(
}
}
#[tauri::command]
#[specta::specta]
pub fn reload_column(label: &str, app_handle: tauri::AppHandle) -> Result<(), String> {
match app_handle.get_webview(label) {
Some(webview) => {
if webview.eval("window.location.reload()").is_ok() {
Ok(())
} else {
Err("Reload column failed".into())
}
}
None => Err("Webview not found".into()),
}
}
#[tauri::command]
#[specta::specta]
pub fn open_window(window: Window, app_handle: tauri::AppHandle) -> Result<(), String> {

View File

@@ -124,6 +124,7 @@ fn main() {
commands::window::close_column,
commands::window::reposition_column,
commands::window::resize_column,
commands::window::reload_column,
commands::window::open_window,
commands::window::open_main_window,
commands::window::set_badge