ktmud commented on a change in pull request #12772:
URL: https://github.com/apache/superset/pull/12772#discussion_r566351426



##########
File path: superset-frontend/src/utils/common.js
##########
@@ -137,3 +137,17 @@ export function applyFormattingToTabularData(data) {
 }
 
 export const noOp = () => undefined;
+
+// Detects the user's OS through the browser
+export const detectOS = () => {
+  const { appVersion } = navigator;
+
+  // Leveraging this condition because of stackOverflow
+  // 
https://stackoverflow.com/questions/11219582/how-to-detect-my-browser-version-and-operating-system-using-javascript
+  if (appVersion.indexOf('Win') !== -1) return 'Windows';

Review comment:
       Can replace `.indexOf` with `.includes`




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org
For additional commands, e-mail: notifications-h...@superset.apache.org

Reply via email to