Skip to content

Commit 96b380d

Browse files
committed
lint pt 2
1 parent c515d00 commit 96b380d

File tree

5 files changed

+25
-7
lines changed

5 files changed

+25
-7
lines changed

apps/oneclient/desktop/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ fn setup_window(handle: &tauri::AppHandle) -> Result<(), Box<dyn std::error::Err
129129
ext::updater::init(handle)?;
130130

131131
let win_clone = win;
132-
let app_handle = handle.clone();
132+
let _app_handle = handle.clone();
133133
tokio::task::spawn(async move {
134134
if let Ok(state) = State::get().await {
135135
let _settings = state.settings.read().await;
@@ -139,7 +139,7 @@ fn setup_window(handle: &tauri::AppHandle) -> Result<(), Box<dyn std::error::Err
139139
{
140140
win_clone.set_decorations(true).ok();
141141
let win_weak = win_clone.clone();
142-
app_handle
142+
_app_handle
143143
.run_on_main_thread(move || {
144144
#[cfg(target_os = "macos")]
145145
{

apps/oneclient/frontend/src/routes/__root.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,17 @@ function useDiscordRPC() {
7272
const provider = location.search.provider ?? null;
7373
const packageId = location.search.packageId ?? null;
7474
const { data: cluster } = useCommand(['getClusterById', clusterId], () => bindings.core.getClusterById(clusterId));
75-
const { data: managedPackage } = useCommand(['getPackage', provider, packageId], () => bindings.core.getPackage(provider!, packageId!), { enabled: provider != null && packageId != null });
75+
76+
const { data: managedPackage } = useCommand(
77+
['getPackage', provider, packageId],
78+
() => {
79+
if (provider == null || packageId == null)
80+
return Promise.reject(new Error('Missing parameters'));
81+
return bindings.core.getPackage(provider, packageId);
82+
},
83+
{ enabled: provider != null && packageId != null },
84+
);
85+
7686
useEffect(() => {
7787
const template = ResolvedPathNames[location.pathname as URLPath];
7888
if (template)

apps/oneclient/frontend/src/routes/app/account/route.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export const Route = createFileRoute('/app/account')({
2020
async beforeLoad({ context, search }) {
2121
// TODO instead replace this with a refresh access_token function. Waiting on binding from @LynithDev
2222
const { profile, search: validSearch } = search;
23+
2324
if (!profile)
2425
return { profileData: null, profile: null, validSearch, playerData: null };
2526

apps/onelauncher/desktop/src/lib.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ fn setup_window(handle: &tauri::AppHandle) -> Result<(), Box<dyn std::error::Err
127127

128128
// Initialize window decorations based on settings
129129
let win_clone = win;
130-
let app_handle = handle.clone();
130+
let _app_handle = handle.clone();
131131
tokio::task::spawn(async move {
132132
if let Ok(state) = State::get().await {
133133
let _settings = state.settings.read().await;
@@ -137,7 +137,7 @@ fn setup_window(handle: &tauri::AppHandle) -> Result<(), Box<dyn std::error::Err
137137
{
138138
win_clone.set_decorations(true).ok();
139139
let win_weak = win_clone.clone();
140-
app_handle
140+
_app_handle
141141
.run_on_main_thread(move || {
142142
#[cfg(target_os = "macos")]
143143
{
@@ -170,7 +170,9 @@ fn setup_window(handle: &tauri::AppHandle) -> Result<(), Box<dyn std::error::Err
170170
}
171171

172172
#[cfg(not(target_os = "macos"))]
173-
win_clone.set_decorations(settings.native_window_frame).ok();
173+
win_clone
174+
.set_decorations(_settings.native_window_frame)
175+
.ok();
174176
}
175177
win_clone.show().ok();
176178
});

apps/onelauncher/frontend/src/routes/app/browser/package.$provider.$id.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,12 @@ function InstallButton() {
260260
return versions.items[0];
261261
}, [browserContext.cluster, versions]);
262262

263-
const download = useDownloadPackage(browserContext.cluster!, provider, version!, true);
263+
const download = useDownloadPackage(
264+
(browserContext.cluster || {}) as ClusterModel,
265+
provider,
266+
(version || {}) as ManagedVersion,
267+
true,
268+
);
264269
const downloadRef = useRef(download);
265270
useEffect(() => {
266271
downloadRef.current.reset();

0 commit comments

Comments
 (0)