@@ -257,6 +257,7 @@ export class IssueReporter extends Disposable {
257
257
const data = await this . issueMainService . $getIssueReporterData ( extension . id ) ;
258
258
extension . extensionData = data ;
259
259
this . receivedExtensionData = true ;
260
+ this . issueReporterModel . update ( { extensionData : data } ) ;
260
261
return data ;
261
262
} catch ( e ) {
262
263
extension . hasIssueDataProviders = false ;
@@ -785,11 +786,10 @@ export class IssueReporter extends Disposable {
785
786
if ( fileOnExtension && selectedExtension ?. hasIssueDataProviders ) {
786
787
const data = this . getExtensionData ( ) ;
787
788
if ( data ) {
788
- ( extensionDataTextArea as HTMLTextAreaElement ) . value = data . toString ( ) ;
789
+ ( extensionDataTextArea as HTMLElement ) . innerText = data . toString ( ) ;
789
790
}
790
791
( extensionDataTextArea as HTMLTextAreaElement ) . readOnly = true ;
791
792
show ( extensionDataBlock ) ;
792
- show ( extensionDataTextArea ) ;
793
793
}
794
794
795
795
if ( issueType === IssueType . Bug ) {
@@ -1136,18 +1136,24 @@ export class IssueReporter extends Disposable {
1136
1136
} else if ( matches [ 0 ] . hasIssueDataProviders ) {
1137
1137
const template = await this . getIssueTemplateFromExtension ( matches [ 0 ] ) ;
1138
1138
const descriptionTextArea = this . getElementById ( 'description' ) ! ;
1139
- const fullTextArea = ( descriptionTextArea as HTMLTextAreaElement ) . value += template ;
1140
- this . issueReporterModel . update ( { issueDescription : fullTextArea } ) ;
1141
-
1139
+ const descriptionText = ( descriptionTextArea as HTMLTextAreaElement ) . value ;
1140
+ if ( descriptionText === '' || ! descriptionText . includes ( template ) ) {
1141
+ const fullTextArea = descriptionText + ( descriptionText === '' ? '' : '\n' ) + template ;
1142
+ ( descriptionTextArea as HTMLTextAreaElement ) . value = fullTextArea ;
1143
+ this . issueReporterModel . update ( { issueDescription : fullTextArea } ) ;
1144
+ }
1142
1145
const extensionDataBlock = document . querySelector ( '.block-extension-data' ) ! ;
1143
1146
show ( extensionDataBlock ) ;
1144
1147
1145
1148
// Start loading for extension data.
1146
- this . setLoading ( ) ;
1149
+ const iconElement = document . createElement ( 'span' ) ;
1150
+ iconElement . classList . add ( ...ThemeIcon . asClassNameArray ( Codicon . loading ) , 'codicon-modifier-spin' ) ;
1151
+ this . setLoading ( iconElement ) ;
1147
1152
await this . getIssueDataFromExtension ( matches [ 0 ] ) ;
1148
- this . removeLoading ( ) ;
1153
+ this . removeLoading ( iconElement ) ;
1149
1154
} else {
1150
1155
this . validateSelectedExtension ( ) ;
1156
+ this . issueReporterModel . update ( { extensionData : undefined } ) ;
1151
1157
const title = ( < HTMLInputElement > this . getElementById ( 'issue-title' ) ) . value ;
1152
1158
this . searchExtensionIssues ( title ) ;
1153
1159
}
@@ -1187,8 +1193,9 @@ export class IssueReporter extends Disposable {
1187
1193
}
1188
1194
}
1189
1195
1190
- private setLoading ( ) {
1196
+ private setLoading ( element : HTMLElement ) {
1191
1197
// Show loading
1198
+ this . receivedExtensionData = false ;
1192
1199
this . updatePreviewButtonState ( ) ;
1193
1200
1194
1201
const extensionDataCaption = this . getElementById ( 'extension-id' ) ! ;
@@ -1199,13 +1206,10 @@ export class IssueReporter extends Disposable {
1199
1206
1200
1207
const showLoading = this . getElementById ( 'ext-loading' ) ! ;
1201
1208
show ( showLoading ) ;
1202
-
1203
- const iconElement = document . createElement ( 'span' ) ;
1204
- iconElement . classList . add ( ...ThemeIcon . asClassNameArray ( Codicon . loading ) , 'codicon-modifier-spin' ) ;
1205
- showLoading . append ( iconElement ) ;
1209
+ showLoading . append ( element ) ;
1206
1210
}
1207
1211
1208
- private removeLoading ( ) {
1212
+ private removeLoading ( element : HTMLElement ) {
1209
1213
this . updatePreviewButtonState ( ) ;
1210
1214
1211
1215
const extensionDataCaption = this . getElementById ( 'extension-id' ) ! ;
@@ -1216,6 +1220,7 @@ export class IssueReporter extends Disposable {
1216
1220
1217
1221
const hideLoading = this . getElementById ( 'ext-loading' ) ! ;
1218
1222
hide ( hideLoading ) ;
1223
+ hideLoading . removeChild ( element ) ;
1219
1224
}
1220
1225
1221
1226
private setExtensionValidationMessage ( ) : void {
0 commit comments