Support deep link for Dyad Pro (#25)
This commit is contained in:
32
src/main/pro.ts
Normal file
32
src/main/pro.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import { readSettings, writeSettings } from "./settings";
|
||||
|
||||
export function handleDyadProReturn({
|
||||
apiKey,
|
||||
budgetResetAt,
|
||||
maxBudget,
|
||||
}: {
|
||||
apiKey: string;
|
||||
budgetResetAt: string | null | undefined;
|
||||
maxBudget: number | null | undefined;
|
||||
}) {
|
||||
const settings = readSettings();
|
||||
writeSettings({
|
||||
providerSettings: {
|
||||
...settings.providerSettings,
|
||||
auto: {
|
||||
...settings.providerSettings.auto,
|
||||
apiKey: {
|
||||
value: apiKey,
|
||||
},
|
||||
},
|
||||
},
|
||||
dyadProBudget:
|
||||
budgetResetAt && maxBudget
|
||||
? {
|
||||
budgetResetAt,
|
||||
maxBudget,
|
||||
}
|
||||
: undefined,
|
||||
enableDyadPro: true,
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user