Commit 44884a88 authored by Timothy J. Baek's avatar Timothy J. Baek
Browse files

feat: randomised suggestion

parent a01fd158
...@@ -4,7 +4,9 @@ ...@@ -4,7 +4,9 @@
let prompts = []; let prompts = [];
$: prompts = suggestionPrompts; $: prompts = suggestionPrompts
.reduce((acc, current) => [...acc, ...[current]], [])
.sort(() => Math.random() - 0.5);
// suggestionPrompts.length <= 4 // suggestionPrompts.length <= 4
// ? suggestionPrompts // ? suggestionPrompts
// : suggestionPrompts.sort(() => Math.random() - 0.5).slice(0, 4); // : suggestionPrompts.sort(() => Math.random() - 0.5).slice(0, 4);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment