feat(ext/sw): get_field_history handler
Decrypts item and calls WASM get_field_history to extract tracked field history for the popup's history view. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -346,9 +346,13 @@ export async function handle(
|
|||||||
return { ok: true, data: result };
|
return { ok: true, data: result };
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handler for this case is added in Task 5.
|
case 'get_field_history': {
|
||||||
case 'get_field_history':
|
const handle = session.getCurrent();
|
||||||
return { ok: false, error: 'not_implemented' };
|
if (!handle || !state.gitHost) return { ok: false, error: 'vault_locked' };
|
||||||
|
const item = await vault.fetchAndDecryptItem(state.gitHost, handle, msg.id);
|
||||||
|
const history = state.wasm.get_field_history(JSON.stringify(item));
|
||||||
|
return { ok: true, data: { history } };
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user