* Store a prompt from the landing page * @param prompt - The prompt text to store * @returns True if successful, false otherwise
(prompt: string)
| 179 | * @returns True if successful, false otherwise |
| 180 | */ |
| 181 | static store(prompt: string): boolean { |
| 182 | if (!prompt || prompt.trim().length === 0) { |
| 183 | return false |
| 184 | } |
| 185 | |
| 186 | const data = { |
| 187 | prompt: prompt.trim(), |
| 188 | timestamp: Date.now(), |
| 189 | } |
| 190 | |
| 191 | return BrowserStorage.setItem(LandingPromptStorage.KEY, data) |
| 192 | } |
| 193 | |
| 194 | /** |
| 195 | * Retrieve and consume the stored prompt |
no test coverage detected