Skip to content

Commit

Permalink
Display ref to verify loaded properly
Browse files Browse the repository at this point in the history
  • Loading branch information
Arithmomaniac committed Feb 11, 2025
1 parent b6a2d24 commit b968249
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>RefDisplayer</title>
<title>Sofer.Ai Sefaria Plugin</title>
<!-- Removed manual script injection for plugin.js -->
<body>
<script>
Expand Down
11 changes: 6 additions & 5 deletions plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { SoferAI, SoferAIClient } from 'soferai';
enum Status {
Idle,
Loading,
Typing,
Finished,
Error
}
Expand Down Expand Up @@ -57,9 +56,9 @@ export default function SefariaPlugin({ sref }: { sref?: string }) {
<small>Whoops! Something went wrong.</small>
</>
)}
{(status === Status.Finished || status === Status.Typing) && (
{(status === Status.Finished) && (
<>
<p>{displayText}</p>
<p>Ref: {displayText}</p>
</>
)}
</div>
Expand All @@ -72,15 +71,17 @@ export default function SefariaPlugin({ sref }: { sref?: string }) {
setApiKey(key);
setTranscriptionId(url);
}}>
<h4>OpenAI Settings</h4>
<h4>Sofer.Ai Settings</h4>
<div>
<label>API Key:<input name="apiKey" type="text" defaultValue={apiKey} /></label>
</div>
<div>
<label>Base URL: <input name="transcriptionId" type="text" defaultValue={transcriptionId} /></label>
<label>Transcription Id:<input name="transcriptionId" type="text" defaultValue={transcriptionId} /></label>
</div>
<button type="submit">Update</button>
</form>

<div style={{ fontSize: '60%' }}>Ref: {sref}</div>
</div>
);
}
Expand Down

0 comments on commit b968249

Please sign in to comment.