fix: button disabled button

This commit is contained in:
Arman committed 2022-11-15 17:00:08 +01:00
1 parent aff4c7dc77
commit 91650cfe8c
2 files changed
+8 -5

No files matched your search

+1 -1
View File
@@ -23,7 +23,7 @@ function createFeedbackStore() {
elapsed: browser ? parseInt(localStorage.getItem('feedbackElapsed')) : 0,
visualized: browser ? parseInt(localStorage.getItem('feedbackVisualized')) : 0,
notification: false,
type: 'nps'
type: 'general'
});
return {
subscribe,
@@ -20,8 +20,6 @@
let btnActive = false;
let options = [
{ label: 'years', value: 'y' },
{ label: 'months', value: 'M' },
{ label: 'days', value: 'd' },
{ label: 'hours', value: 'h' },
{ label: 'minutes', value: 'm' },
@@ -64,6 +62,7 @@
try {
await sdkForConsole.projects.updateAuthDuration(projectId, timeToSeconds(time, period));
invalidate(Dependencies.PROJECT);
period = 's';
addNotification({
type: 'success',
@@ -77,6 +76,10 @@
});
}
}
project.subscribe((p) => {
time = p.authDuration;
});
</script>
<Container>
@@ -159,14 +162,14 @@
<form class="form u-grid u-gap-16">
<ul class="form-list is-multiple">
<InputNumber id="length" label="Length" bind:value={time} />
<InputSelect id="period" label="Time Period" value={period} {options} />
<InputSelect id="period" label="Time Period" bind:value={period} {options} />
</ul>
</form>
</svelte:fragment>
<svelte:fragment slot="actions">
<Button
disabled={period !== 's' || time !== $project.authDuration}
disabled={period === 's' && time === $project.authDuration}
on:click={() => {
updateSessionLength();
}}>