File tree Expand file tree Collapse file tree
frontend/src/lib/components/modals Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77 import { error } from ' $lib/store/generalStore' ;
88 import { offline } from ' $lib/store/settingsStore' ;
99 import { InstallModpackRelease } from ' $wailsjs/go/ficsitcli/ficsitCLI' ;
10- import { profiles } from ' $lib/store/ficsitCLIStore' ;
10+ import { profiles , selectedProfile } from ' $lib/store/ficsitCLIStore' ;
1111
1212 export let parent: { onClose: () => void };
1313
4343 parent .onClose ();
4444 }
4545
46+ function switchToProfile() {
47+ if (! modpack ) return ;
48+ const modpackName = modpack .name ;
49+ selectedProfile .asyncSet (` ${modpackName }-${version } ` );
50+ parent .onClose ();
51+ }
52+
4653 $ : renderedLogo = modpack ?.logo || ' https://ficsit.app/images/no_image.webp' ;
4754 </script >
4855
7178 {/if }
7279 </section >
7380 <footer class =" card-footer" >
74- <button
75- class =" btn text-primary-600 variant-ringed"
76- disabled ={isInstalled }
77- on:click ={install }>
78- {#if isInstalled }
79- <T defaultValue =" Already installed" keyName =" external-install-modpack.already-installed" />
80- {:else }
81+ {#if isInstalled }
82+ <p class =" text-sm text-red-500" >
83+ <T defaultValue =" This profile already exists" keyName =" external-install-modpack.already-installed-warning" />
84+ </p >
85+ <button
86+ class =" btn text-primary-600 variant-ringed"
87+ on:click ={switchToProfile }>
88+ <T defaultValue =" Switch to profile" keyName =" external-install-modpack.already-installed" />
89+ </button >
90+ {:else }
91+ <button
92+ class =" btn text-primary-600 variant-ringed"
93+ on:click ={install }>
8194 <T defaultValue =" Install" keyName =" external-install-modpack.install" />
82- { /if }
83- </ button >
95+ </ button >
96+ { /if }
8497 <button
8598 class =" btn"
8699 on:click ={parent .onClose }>
You can’t perform that action at this time.
0 commit comments