Use proper Windows APIs for checking/setting default app (#5000)

# Description of Changes
Use proper Windows APIs for checking/setting default app

---------

Co-authored-by: Connor Yoh <[email protected]>
Co-authored-by: ConnorYoh <[email protected]>
This commit is contained in:
James Brunton
2025-11-25 21:31:02 +00:00
committed by GitHub
co-authored by Connor Yoh ConnorYoh
parent 8016d271aa
commit d8a99fcb07
7 changed files with 160 additions and 57 deletions
@@ -22,10 +22,10 @@ export const defaultAppService = {
* Set or prompt to set Stirling PDF as default PDF handler
* Returns a status string indicating what happened
*/
async setAsDefaultPdfHandler(): Promise<'set_successfully' | 'opened_settings' | 'error'> {
async setAsDefaultPdfHandler(): Promise<'set_successfully' | 'opened_dialog' | 'error'> {
try {
const result = await invoke<string>('set_as_default_pdf_handler');
return result as 'set_successfully' | 'opened_settings';
return result as 'set_successfully' | 'opened_dialog';
} catch (error) {
console.error('[DefaultApp] Failed to set default handler:', error);
return 'error';