lint pt 2
This commit is contained in:
parent
c515d00da1
commit
96b380db25
5 changed files with 25 additions and 7 deletions
|
|
@ -129,7 +129,7 @@ fn setup_window(handle: &tauri::AppHandle) -> Result<(), Box<dyn std::error::Err
|
|||
ext::updater::init(handle)?;
|
||||
|
||||
let win_clone = win;
|
||||
let app_handle = handle.clone();
|
||||
let _app_handle = handle.clone();
|
||||
tokio::task::spawn(async move {
|
||||
if let Ok(state) = State::get().await {
|
||||
let _settings = state.settings.read().await;
|
||||
|
|
@ -139,7 +139,7 @@ fn setup_window(handle: &tauri::AppHandle) -> Result<(), Box<dyn std::error::Err
|
|||
{
|
||||
win_clone.set_decorations(true).ok();
|
||||
let win_weak = win_clone.clone();
|
||||
app_handle
|
||||
_app_handle
|
||||
.run_on_main_thread(move || {
|
||||
#[cfg(target_os = "macos")]
|
||||
{
|
||||
|
|
|
|||
|
|
@ -72,7 +72,17 @@ function useDiscordRPC() {
|
|||
const provider = location.search.provider ?? null;
|
||||
const packageId = location.search.packageId ?? null;
|
||||
const { data: cluster } = useCommand(['getClusterById', clusterId], () => bindings.core.getClusterById(clusterId));
|
||||
const { data: managedPackage } = useCommand(['getPackage', provider, packageId], () => bindings.core.getPackage(provider!, packageId!), { enabled: provider != null && packageId != null });
|
||||
|
||||
const { data: managedPackage } = useCommand(
|
||||
['getPackage', provider, packageId],
|
||||
() => {
|
||||
if (provider == null || packageId == null)
|
||||
return Promise.reject(new Error('Missing parameters'));
|
||||
return bindings.core.getPackage(provider, packageId);
|
||||
},
|
||||
{ enabled: provider != null && packageId != null },
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
const template = ResolvedPathNames[location.pathname as URLPath];
|
||||
if (template)
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ export const Route = createFileRoute('/app/account')({
|
|||
async beforeLoad({ context, search }) {
|
||||
// TODO instead replace this with a refresh access_token function. Waiting on binding from @LynithDev
|
||||
const { profile, search: validSearch } = search;
|
||||
|
||||
if (!profile)
|
||||
return { profileData: null, profile: null, validSearch, playerData: null };
|
||||
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ fn setup_window(handle: &tauri::AppHandle) -> Result<(), Box<dyn std::error::Err
|
|||
|
||||
// Initialize window decorations based on settings
|
||||
let win_clone = win;
|
||||
let app_handle = handle.clone();
|
||||
let _app_handle = handle.clone();
|
||||
tokio::task::spawn(async move {
|
||||
if let Ok(state) = State::get().await {
|
||||
let _settings = state.settings.read().await;
|
||||
|
|
@ -137,7 +137,7 @@ fn setup_window(handle: &tauri::AppHandle) -> Result<(), Box<dyn std::error::Err
|
|||
{
|
||||
win_clone.set_decorations(true).ok();
|
||||
let win_weak = win_clone.clone();
|
||||
app_handle
|
||||
_app_handle
|
||||
.run_on_main_thread(move || {
|
||||
#[cfg(target_os = "macos")]
|
||||
{
|
||||
|
|
@ -170,7 +170,9 @@ fn setup_window(handle: &tauri::AppHandle) -> Result<(), Box<dyn std::error::Err
|
|||
}
|
||||
|
||||
#[cfg(not(target_os = "macos"))]
|
||||
win_clone.set_decorations(settings.native_window_frame).ok();
|
||||
win_clone
|
||||
.set_decorations(_settings.native_window_frame)
|
||||
.ok();
|
||||
}
|
||||
win_clone.show().ok();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -260,7 +260,12 @@ function InstallButton() {
|
|||
return versions.items[0];
|
||||
}, [browserContext.cluster, versions]);
|
||||
|
||||
const download = useDownloadPackage(browserContext.cluster!, provider, version!, true);
|
||||
const download = useDownloadPackage(
|
||||
(browserContext.cluster || {}) as ClusterModel,
|
||||
provider,
|
||||
(version || {}) as ManagedVersion,
|
||||
true,
|
||||
);
|
||||
const downloadRef = useRef(download);
|
||||
useEffect(() => {
|
||||
downloadRef.current.reset();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue