fix(webview): issue/mr details not showing for VS Code 1.53.0 (insiders)
The webview initialisation relied on the panel.onDidChangeViewState
event being triggered during the initial activation. i.e. As soon as user opened the issue detail.
The core team deemed this behaviour an unintentional bug and fixed it in this commit. This has been released in insiders version and is going to be released in the 1.53.0
version. The new behaviour is that the panel.onDidChangeViewState
only triggers when the state changes (e.g. when the user leaves the tab or activates it again).
The fix is to call the panel initialisation without relying on the panel.onDidChangeViewState
event being triggered. Because in the new version it is not called till later.
This MR fixes the bug while keeping backwards compatibility with the current VS Code version. The drawback is that current version and earlier (<= 1.52.1
) will trigger the initialisation twice causing two sets of API calls. The webview is opened roughly 800 times per week (internal only). So I'm not worried if the load doubles for a week (VS Code 1.53.0
ships in early Feb)
Related to #304 (closed)