File size: 395 Bytes
89af3b2
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
const PENDING_ASK_KEY = "loopable.ask.pending";

/** Clear the handoff before returning it so repeated effects cannot send it twice. */
export function takePendingAsk(): string | null {
  try {
    const pending = sessionStorage.getItem(PENDING_ASK_KEY);
    sessionStorage.removeItem(PENDING_ASK_KEY);
    return pending?.trim().slice(0, 500).trim() || null;
  } catch {
    return null;
  }
}