mirror of
https://codeberg.org/PLG-Development/PLG-MuDiCS
synced 2026-07-06 00:47:09 +00:00
refactor(control): create gloabel type CompleteFileLoadingData
This commit is contained in:
@@ -11,7 +11,7 @@
|
|||||||
type Inode,
|
type Inode,
|
||||||
get_file_primary_key,
|
get_file_primary_key,
|
||||||
type FileOnDisplay,
|
type FileOnDisplay,
|
||||||
type FileLoadingData
|
type CompleteFileLoadingData
|
||||||
} from '$lib/ts/types';
|
} from '$lib/ts/types';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -45,12 +45,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
let loading_data:
|
let loading_data:
|
||||||
| Observable<{
|
| Observable<CompleteFileLoadingData>
|
||||||
is_loading: boolean;
|
|
||||||
total_percentage: number;
|
|
||||||
total_seconds_until_finish: number;
|
|
||||||
display_data: FileLoadingData[];
|
|
||||||
}>
|
|
||||||
| undefined = $state();
|
| undefined = $state();
|
||||||
$effect(() => {
|
$effect(() => {
|
||||||
const d = $selected_display_ids;
|
const d = $selected_display_ids;
|
||||||
@@ -197,12 +192,7 @@
|
|||||||
async function get_loading_data(
|
async function get_loading_data(
|
||||||
file_primary_key: string,
|
file_primary_key: string,
|
||||||
selected_display_ids: string[]
|
selected_display_ids: string[]
|
||||||
): Promise<{
|
): Promise<CompleteFileLoadingData> {
|
||||||
is_loading: boolean;
|
|
||||||
total_percentage: number;
|
|
||||||
total_seconds_until_finish: number;
|
|
||||||
display_data: FileLoadingData[];
|
|
||||||
}> {
|
|
||||||
const file_on_display_data: FileOnDisplay[] = await db.files_on_display
|
const file_on_display_data: FileOnDisplay[] = await db.files_on_display
|
||||||
.where('file_primary_key')
|
.where('file_primary_key')
|
||||||
.equals(file_primary_key)
|
.equals(file_primary_key)
|
||||||
|
|||||||
@@ -66,6 +66,13 @@ export type FileLoadingData = {
|
|||||||
seconds_until_finish: number;
|
seconds_until_finish: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type CompleteFileLoadingData = {
|
||||||
|
is_loading: boolean;
|
||||||
|
total_percentage: number;
|
||||||
|
total_seconds_until_finish: number;
|
||||||
|
display_data: { loading_data: FileLoadingData; display_name: string }[];
|
||||||
|
};
|
||||||
|
|
||||||
export type Inode = {
|
export type Inode = {
|
||||||
path: string;
|
path: string;
|
||||||
name: string;
|
name: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user