feat: poll for /tmp/regex.txt and process contents
This commit is contained in:
parent
2747a978c7
commit
090986ca5a
|
@ -616,6 +616,21 @@ const App = ({ config, settings, startupWarnings = [], version }: AppProps) => {
|
|||
[addMessage],
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
const interval = setInterval(() => {
|
||||
const filePath = '/tmp/regex.txt';
|
||||
if (fs.existsSync(filePath)) {
|
||||
const content = fs.readFileSync(filePath, 'utf-8');
|
||||
if (content.trim().length > 0) {
|
||||
handleFinalSubmit(content);
|
||||
}
|
||||
fs.unlinkSync(filePath);
|
||||
}
|
||||
}, 5000); // Check every 5 seconds
|
||||
|
||||
return () => clearInterval(interval);
|
||||
}, [handleFinalSubmit]);
|
||||
|
||||
const handleIdePromptComplete = useCallback(
|
||||
(result: IdeIntegrationNudgeResult) => {
|
||||
if (result.userSelection === 'yes') {
|
||||
|
|
Loading…
Reference in New Issue