diff options
author | Tyler Schicke <tyler_schicke@brown.edu> | 2019-02-14 05:43:09 -0500 |
---|---|---|
committer | Tyler Schicke <tyler_schicke@brown.edu> | 2019-02-14 05:43:09 -0500 |
commit | 4bcc62fd164c5ee6c4fc50077753ba7d969478e3 (patch) | |
tree | d3a0a7ffc657ef890e640c52dd1e906bf19701c0 /src/fields/Key.ts | |
parent | 4eb4ef6e073652661dcfa30597f63e93058fb876 (diff) |
Got almost all of collaboration and server communication working
Diffstat (limited to 'src/fields/Key.ts')
-rw-r--r-- | src/fields/Key.ts | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/fields/Key.ts b/src/fields/Key.ts index 1e878a361..51d8e093c 100644 --- a/src/fields/Key.ts +++ b/src/fields/Key.ts @@ -12,11 +12,17 @@ export class Key extends Field { return this.name; } - constructor(name: string, id?: string) { + constructor(name: string, id?: string, save: boolean = true) { super(id || Utils.GenerateDeterministicGuid(name)); this.name = name; - Server.UpdateField(this) + if (save) { + Server.UpdateField(this) + } + } + + UpdateFromServer(data: string) { + this.name = data; } TrySetValue(value: any): boolean { |