Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
Render shot capture time only when in browser. (#4288)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenba committed Apr 6, 2018
1 parent 290479b commit e0eb1d7
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 9 deletions.
1 change: 0 additions & 1 deletion .env.dev
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ USER_SETTINGS=true
ENABLE_ANNOTATIONS=true
SCREENSHOTS_UPLOAD_BINARY=true

export NODE_ICU_DATA="$(pwd)/node_modules/full-icu"
# For false, unset or set to empty string
export NO_UGLIFY=true
export NODE_ENV=dev
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ COPY build/shared /app/build/shared
COPY node_modules /app/node_modules
COPY bin/_run-docker /app/bin/
COPY build/screenshots.xpi /app/build/xpi/screenshots.xpi
ENV NODE_ICU_DATA="/app/node_modules/full-icu"
RUN cd app && npm install

CMD /app/bin/_run-docker
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"fluent-intl-polyfill": "0.1.0",
"fluent-langneg": "0.1.0",
"fluent-react": "0.4.1",
"full-icu": "1.2.1",
"jpm": "1.3.1",
"keygrip": "1.0.2",
"mobile-detect": "1.3.7",
Expand Down
9 changes: 4 additions & 5 deletions server/src/pages/shot/time-diff.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,16 @@ exports.TimeDiff = class TimeDiff extends React.Component {
}

dateString(d) {
if (!this.state.useLocalTime) {
return "";
}
if (!(d instanceof Date)) {
d = new Date(d);
}
if (this.props.userLocales && this.props.userLocales.length) {
return d.toLocaleString(this.props.userLocales[0]);
}
return d.toLocaleString();
}
};

exports.TimeDiff.propTypes = {
date: PropTypes.number,
userLocales: PropTypes.array
date: PropTypes.number
}
2 changes: 1 addition & 1 deletion server/src/pages/shot/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ class Body extends React.Component {

const linkTextShort = shot.urlDisplay;

const timeDiff = <TimeDiff date={shot.createdDate} userLocales={this.props.userLocales} />;
const timeDiff = <TimeDiff date={shot.createdDate} />;
let expiresDiff = null;
if (this.props.isOwner) {
expiresDiff = <span className="expire-widget">
Expand Down

0 comments on commit e0eb1d7

Please sign in to comment.