File tree Expand file tree Collapse file tree 2 files changed +27
-12
lines changed
src/packages/frontend/frame-editors/time-travel-editor Expand file tree Collapse file tree 2 files changed +27
-12
lines changed Original file line number Diff line number Diff line change @@ -462,7 +462,7 @@ export class TimeTravelActions extends CodeEditorActions<TimeTravelState> {
462
462
} ) ;
463
463
} ;
464
464
465
- private updateGitVersions = async ( ) => {
465
+ updateGitVersions = async ( ) => {
466
466
// versions is an ordered list of Date objects, one for each commit that involves this file.
467
467
try {
468
468
const { stdout } = await this . gitCommand ( [
Original file line number Diff line number Diff line change 6
6
// Time travel editor react component
7
7
8
8
import { useState } from "react" ;
9
- import { Checkbox , Tooltip } from "antd" ;
9
+ import { Button , Checkbox , Tooltip } from "antd" ;
10
10
import { Map } from "immutable" ;
11
11
import { redux } from "../../app-framework" ;
12
12
import { Loading } from "../../components" ;
@@ -327,16 +327,31 @@ export function TimeTravel(props: Props) {
327
327
</ Tooltip >
328
328
) }
329
329
{ git && (
330
- < Tooltip title = "Show Git history instead of CoCalc edit history" >
331
- < Checkbox
332
- defaultChecked = { gitMode }
333
- onChange = { ( e ) =>
334
- props . actions . setGitMode ( props . id , e . target . checked )
335
- }
336
- >
337
- Git
338
- </ Checkbox >
339
- </ Tooltip >
330
+ < >
331
+ < Tooltip title = "Show Git history instead of CoCalc edit history" >
332
+ < Checkbox
333
+ defaultChecked = { gitMode }
334
+ onChange = { ( e ) =>
335
+ props . actions . setGitMode ( props . id , e . target . checked )
336
+ }
337
+ >
338
+ Git
339
+ </ Checkbox >
340
+ </ Tooltip >
341
+ { gitMode && (
342
+ < Tooltip title = "Scan local Git repository for new revisions to this file" >
343
+ < Button
344
+ size = "small"
345
+ style = { { marginRight : "5px" } }
346
+ onClick = { ( ) => {
347
+ props . actions . updateGitVersions ( ) ;
348
+ } }
349
+ >
350
+ Refresh
351
+ </ Button >
352
+ </ Tooltip >
353
+ ) }
354
+ </ >
340
355
) }
341
356
{ renderNavigationButtons ( ) }
342
357
< div style = { { display : "inline-flex" , margin : "0 5px" } } >
You can’t perform that action at this time.
0 commit comments