zack commited on
Commit
740a8bd
1 Parent(s): 89c0e23

🔧 fix(navbar): correct parsing errors and improve functionality

Browse files
frontend/components/Navagation/navbar.js CHANGED
@@ -56,9 +56,9 @@ export default class Navbar extends Component{
56
  */
57
  appendStreamNode = async (type) => {
58
  const pattern = {
59
- local : /^https?:\/\/(localhost)*(:[0-9]+)?(\/)?$/,
60
- share : /^https?:\/\/*([0-9]{5})*(-gradio)*(.app)?(\/)?$/,
61
- hugginFace : /^https?:\/\/*(hf.space)\/*(embed)\/*([a-zA-Z0-9+_-]+)\/*([a-zA-Z0-9+_-]+)\/*([+])?(\/)?$/
62
  }
63
 
64
  if (this.state.name.length > 20 ||
 
56
  */
57
  appendStreamNode = async (type) => {
58
  const pattern = {
59
+ local : new RegExp("^https?:\/\/localhost(:[0-9]+)?(\/)?$"),
60
+ share : new RegExp("^https?:\/\/[0-9a-zA-Z-]+\.gradio\.live(\/)?$"),
61
+ hugginFace : new RegExp("^https?:\/\/[a-zA-Z0-9-]+\-gradio\.hf\.space(\/)?$")
62
  }
63
 
64
  if (this.state.name.length > 20 ||