Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,11 @@ export class StatusIndicatorComponent extends React.Component<Props, State> {
return <Link to="/admin?tab=LanguageServers">install it here</Link>;
case CTA.SWITCH_TO_HEAD:
const { uri, path } = this.props.currentStatusPath!;
return <Link to={`/${uri}/${this.props.pathType}/HEAD/${path}`}>switch to HEAD</Link>;
const headUrl = path
? `/${uri}/${this.props.pathType}/HEAD/${path}`
: `/${uri}/${this.props.pathType}/HEAD/`;

return <Link to={headUrl}>switch to HEAD</Link>;
}
}
}
Expand Down
14 changes: 8 additions & 6 deletions x-pack/legacy/plugins/code/public/sagas/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,15 @@ function* startPollingStatus(location: FetchFilePayload) {
while (isEqual(location, currentStatusPath)) {
const previousStatus: StatusReport = yield select(statusSelector);
const newStatus: StatusReport = yield call(fetchStatus, location);
yield call(compareStatus, previousStatus, newStatus);
const delayMs =
newStatus.langServerStatus === RepoFileStatus.LANG_SERVER_IS_INITIALIZING
? STATUS_POLLING_FREQ_HIGH_MS
: STATUS_POLLING_FREQ_LOW_MS;
let delayMs = STATUS_POLLING_FREQ_LOW_MS;
if (newStatus) {
yield call(compareStatus, previousStatus, newStatus);
if (newStatus.langServerStatus === RepoFileStatus.LANG_SERVER_IS_INITIALIZING) {
delayMs = STATUS_POLLING_FREQ_HIGH_MS;
}
currentStatusPath = yield select((state: RootState) => state.status.currentStatusPath);
}
yield call(delay, delayMs);
currentStatusPath = yield select((state: RootState) => state.status.currentStatusPath);
}
}

Expand Down