Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -261,19 +261,22 @@ export function KiloPassSubscriptionSettingsModal(props: SettingsModalProps) {
const pendingChange = Boolean(scheduledChange);
const showUpdatePanel = panel === 'update';

const cancellationReasons = useMemo(
() =>
[
'Too expensive',
'Not using it enough',
'Missing features',
'Bugs / reliability issues',
'Performance issues',
'Using another tool',
'Other',
] as const,
[]
);
const cancellationReasons = useMemo(() => {
const reasons = [
'Too expensive',
'Not using it enough',
'Missing features',
'Bugs / reliability issues',
'Performance issues',
'Using another tool',
];
// Fisher-Yates shuffle
for (let i = reasons.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
[reasons[i], reasons[j]] = [reasons[j], reasons[i]];
}
return [...reasons, 'Other'];
}, []);

const toggleCancellationReason = (reason: string) => {
setSelectedCancellationReasons(current =>
Expand Down