@@ -147,28 +147,31 @@ export const statusBarTimeline: JupyterFrontEndPlugin<void> = {
147
147
statusBar : IStatusBar ,
148
148
drive : ICollaborativeDrive
149
149
) : Promise < void > => {
150
- function isYDrive ( drive : YDrive | ICollaborativeDrive ) : drive is YDrive {
151
- return 'getProviderForPath' in drive ;
152
- }
153
150
try {
154
151
let sliderItem : Widget | null = null ;
155
152
let timelineWidget : TimelineWidget | null = null ;
156
153
157
- const updateTimelineForDocument = async ( documentPath : string ) => {
158
- if ( drive && isYDrive ( drive ) ) {
154
+ const updateTimelineForDocument = async (
155
+ documentPath : string ,
156
+ documentId : string
157
+ ) => {
158
+ if ( drive ) {
159
+ // Remove 'RTC:' from document path
160
+ documentPath = documentPath . slice ( drive . name . length + 1 ) ;
159
161
// Dispose of the previous timelineWidget if it exists
160
162
if ( timelineWidget ) {
161
163
timelineWidget . dispose ( ) ;
162
164
timelineWidget = null ;
163
165
}
164
166
165
- const provider = ( await drive . getProviderForPath (
166
- documentPath
167
- ) ) as IForkProvider ;
167
+ const [ format , type ] = documentId . split ( ':' ) ;
168
+ const provider = drive . providers . get (
169
+ `${ format } :${ type } :${ documentPath } `
170
+ ) as IForkProvider ;
168
171
const fullPath = URLExt . join (
169
172
app . serviceManager . serverSettings . baseUrl ,
170
173
DOCUMENT_TIMELINE_URL ,
171
- documentPath . split ( ':' ) [ 1 ]
174
+ documentPath
172
175
) ;
173
176
174
177
timelineWidget = new TimelineWidget (
@@ -194,7 +197,13 @@ export const statusBarTimeline: JupyterFrontEndPlugin<void> = {
194
197
timelineWidget = null ;
195
198
}
196
199
if ( currentWidget && 'context' in currentWidget ) {
197
- await updateTimelineForDocument ( currentWidget . context . path ) ;
200
+ await currentWidget . context . ready ;
201
+ await updateTimelineForDocument (
202
+ currentWidget . context . path ,
203
+ currentWidget . context . model . sharedModel . getState (
204
+ 'document_id'
205
+ ) as string
206
+ ) ;
198
207
}
199
208
} ) ;
200
209
}
0 commit comments