mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Notebooks: Fix double-click to edit with source as array (#7027)
* Fix dbl click to edit with source as array * Fix equality check
This commit is contained in:
committed by
Karl Burtram
parent
a5c824a318
commit
acc85c2c23
@@ -164,10 +164,12 @@ export class TextCellComponent extends CellView implements OnInit, OnChanges {
|
|||||||
*/
|
*/
|
||||||
private updatePreview(): void {
|
private updatePreview(): void {
|
||||||
let trustedChanged = this.cellModel && this._lastTrustedMode !== this.cellModel.trustedMode;
|
let trustedChanged = this.cellModel && this._lastTrustedMode !== this.cellModel.trustedMode;
|
||||||
let contentChanged = this._content !== this.cellModel.source || this.cellModel.source.length === 0;
|
let cellModelSourceJoined = Array.isArray(this.cellModel.source) ? this.cellModel.source.join('') : this.cellModel.source;
|
||||||
|
let contentJoined = Array.isArray(this._content) ? this._content.join('') : this._content;
|
||||||
|
let contentChanged = contentJoined !== cellModelSourceJoined || cellModelSourceJoined.length === 0;
|
||||||
if (trustedChanged || contentChanged) {
|
if (trustedChanged || contentChanged) {
|
||||||
this._lastTrustedMode = this.cellModel.trustedMode;
|
this._lastTrustedMode = this.cellModel.trustedMode;
|
||||||
if (!this.cellModel.source && !this.isEditMode) {
|
if ((!cellModelSourceJoined) && !this.isEditMode) {
|
||||||
this._content = localize('doubleClickEdit', "Double-click to edit");
|
this._content = localize('doubleClickEdit', "Double-click to edit");
|
||||||
} else {
|
} else {
|
||||||
this._content = this.cellModel.source;
|
this._content = this.cellModel.source;
|
||||||
|
|||||||
Reference in New Issue
Block a user