mirror of
https://github.com/arsvendg/Stirling-PDF.git
synced 2026-07-15 02:54:06 +02:00
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:
co-authored by
Connor Yoh
ConnorYoh
parent
8016d271aa
commit
d8a99fcb07
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user