feat: new billing and restrict access when trial has ended
* fix: simply billing * fix usage graph * imporve billing more + supporter prompt on self-hosting * revert service change * revert query builder * fix: comments
This commit is contained in:
committed by
GitHub
parent
bbd30ca6e0
commit
9cafd61b25
@@ -5,12 +5,20 @@ import { pick } from 'ramda';
|
||||
import { useEffect, useMemo, useRef, useState } from 'react';
|
||||
import { z } from 'zod';
|
||||
|
||||
const VALID_COOKIES = ['ui-theme', 'chartType', 'range'] as const;
|
||||
const VALID_COOKIES = [
|
||||
'ui-theme',
|
||||
'chartType',
|
||||
'range',
|
||||
'supporter-prompt-closed',
|
||||
] as const;
|
||||
const COOKIE_EVENT_NAME = '__cookie-change';
|
||||
|
||||
const setCookieFn = createServerFn({ method: 'POST' })
|
||||
.inputValidator(z.object({ key: z.enum(VALID_COOKIES), value: z.string() }))
|
||||
.handler(({ data: { key, value } }) => {
|
||||
if (!VALID_COOKIES.includes(key)) {
|
||||
return;
|
||||
}
|
||||
setCookie(key, value);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user