Browse Source

add BUILD_DATE to welcome toast

Alexander Rose 5 years ago
parent
commit
361911de9b
1 changed files with 6 additions and 1 deletions
  1. 6 1
      src/structure-viewer/index.ts

+ 6 - 1
src/structure-viewer/index.ts

@@ -29,6 +29,11 @@ require('./skin/rcsb.scss')
 declare const __RCSB_MOLSTAR_VERSION__: string
 export const RCSB_MOLSTAR_VERSION = __RCSB_MOLSTAR_VERSION__;
 
+/** unix time stamp, to be filled in at bundle build time */
+declare const __VERSION_TIMESTAMP__: number
+export const BUILD_TIMESTAMP = __VERSION_TIMESTAMP__;
+export const BUILD_DATE = new Date(BUILD_TIMESTAMP);
+
 export const DefaultStructureViewerProps: StructureViewerProps = {
     volumeServerUrl: '//maps.rcsb.org/',
     modelUrlProvider: (pdbId: string) => {
@@ -110,7 +115,7 @@ export class StructureViewer {
 
         PluginCommands.Toast.Show(this.plugin, {
             title: 'Welcome',
-            message: `RCSB PDB Mol* Viewer ${RCSB_MOLSTAR_VERSION}`,
+            message: `RCSB PDB Mol* Viewer ${RCSB_MOLSTAR_VERSION} [${BUILD_DATE.toLocaleString()}]`,
             key: 'toast-welcome',
             timeoutMs: 5000
         })