Repository: syncthing/syncthing
File: gui/default/syncthing/core/syncthingController.js (JavaScript)

Code before:
            if (notifyCount > 0) {
                return 'notify';
            }

            // all used devices are paused except (this) one
            if (pauseCount === deviceCount - 1) {
                return 'pause';
            }

            return 'default';
        };

        $scope.deviceAddr = function (deviceCfg) {
            var conn = $scope.connections[deviceCfg.deviceID];
            if (conn && conn.connected) {
                return conn.address;
            }
            return '?';
        };

        $scope.rdConnType = function(deviceID){
            var conn = $scope.connections[deviceID];
            if(!conn)
                return -1;
                
            if (conn.type.startsWith('relay'))
                return 1;
            
            if (conn.type.startsWith('quic'))
                return 2;
            
            if(conn.type.startsWith('tcp'))
                return 3+rdAddrType(conn.address);

            return -1;
        }

        function rdAddrType(address){
            var re = /(^(?:127\.|0?10\.|172\.0?1[6-9]\.|172\.0?2[0-9]\.|172\.0?3[01]\.|192\.168\.|169\.254\.|::1|[fF][cCdD][0-9a-fA-F]{2}:|[fF][eE][89aAbB][0-9a-fA-F]:))/
            if(re.test(address)) 
                return 1;
        
            return 0;
        }

        $scope.rdConnTypeString = function(type){
            switch (type) {
                case 1:
                    return $translate.instant('Relay');
                case 2:
                    return $translate.instant('QUIC');

Review comment (suggestion):
```suggestion
            if (conn.type.indexOf('relay') === 0)
```

This makes the code work in IE11 and prevents otherwise error log spam in the browser (ref: https://github.com/syncthing/syncthing/pull/8097).

Code after:
            if (notifyCount > 0) {
                return 'notify';
            }

            // all used devices are paused except (this) one
            if (pauseCount === deviceCount - 1) {
                return 'pause';
            }

            return 'default';
        };

        $scope.deviceAddr = function (deviceCfg) {
            var conn = $scope.connections[deviceCfg.deviceID];
            if (conn && conn.connected) {
                return conn.address;
            }
            return '?';
        };

        $scope.rdConnType = function(deviceID) {
            var conn = $scope.connections[deviceID];
            if(!conn)
                return "-1";
                
            if (conn.type.indexOf('relay') === 0)
                return "relay";
            
            if (conn.type.indexOf('quic') === 0)
                return "quic";
            
            if(conn.type.indexOf('tcp') === 0)
                return "tcp"+rdAddrType(conn.address);

            return "disconnected";
        }

        function rdAddrType(address) {
            var re = /(^(?:127\.|0?10\.|172\.0?1[6-9]\.|172\.0?2[0-9]\.|172\.0?3[01]\.|192\.168\.|169\.254\.|::1|[fF][cCdD][0-9a-fA-F]{2}:|[fF][eE][89aAbB][0-9a-fA-F]:))/
            if(re.test(address)) 
                return "lan";
        
            return "wan";
        }

        $scope.rdConnTypeString = function(type) {
            switch (type) {
                case "relay":
                    return $translate.instant('Relay');
                case "quic":
                    return $translate.instant('QUIC');